2
2
mirror of https://github.com/octoleo/restic.git synced 2024-09-22 11:59:00 +00:00

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

View File

@ -105,7 +105,9 @@ func startClient(cfg Config) (*SFTP, error) {
client, err := sftp.NewClientPipe(rd, wr, client, err := sftp.NewClientPipe(rd, wr,
// write multiple packets (32kb) in parallel per file // write multiple packets (32kb) in parallel per file
// not strictly necessary as we use ReadFromWithConcurrency // 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 { if err != nil {
return nil, errors.Errorf("unable to start the sftp session, error: %v", err) return nil, errors.Errorf("unable to start the sftp session, error: %v", err)
} }