sftp: slightly increase write concurrency

This should increase upload throughput for high latency links a bit.
This commit is contained in:
Michael Eischer 2024-04-28 11:50:09 +02:00
parent 669a669603
commit 935327d480
1 changed files with 3 additions and 1 deletions

View File

@ -105,7 +105,9 @@ func startClient(cfg Config) (*SFTP, error) {
client, err := sftp.NewClientPipe(rd, wr,
// write multiple packets (32kb) in parallel per file
// not strictly necessary as we use ReadFromWithConcurrency
sftp.UseConcurrentWrites(true))
sftp.UseConcurrentWrites(true),
// increase send buffer per file to 4MB
sftp.MaxConcurrentRequestsPerFile(128))
if err != nil {
return nil, errors.Errorf("unable to start the sftp session, error: %v", err)
}