From eaa0040dd58ed82b63fc69197cc50a36889c605b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Thu, 12 Dec 2024 16:33:14 -0500 Subject: [PATCH 1/2] client: Improve SFTP performance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- client/incus_instances.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/incus_instances.go b/client/incus_instances.go index c23453c85e..a639822e1c 100644 --- a/client/incus_instances.go +++ b/client/incus_instances.go @@ -1696,7 +1696,7 @@ func (r *ProtocolIncus) GetInstanceFileSFTP(instanceName string) (*sftp.Client, } // Get a SFTP client. - client, err := sftp.NewClientPipe(conn, conn) + client, err := sftp.NewClientPipe(conn, conn, sftp.MaxPacketUnchecked(128*1024)) if err != nil { _ = conn.Close() return nil, err From 042132a48bc997c645d97331a71f1db233cf3834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Thu, 12 Dec 2024 16:34:26 -0500 Subject: [PATCH 2/2] incusd/main_forkfile: Improve SFTP performance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- cmd/incusd/main_forkfile.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/incusd/main_forkfile.go b/cmd/incusd/main_forkfile.go index 71b8fbe014..5bf89cfdb9 100644 --- a/cmd/incusd/main_forkfile.go +++ b/cmd/incusd/main_forkfile.go @@ -229,7 +229,7 @@ func (c *cmdForkfile) Run(cmd *cobra.Command, args []string) error { mu.Unlock() // Spawn the server. - server, err := sftp.NewServer(conn) + server, err := sftp.NewServer(conn, sftp.WithAllocator()) if err != nil { return }