Compare commits

...

6 Commits

Author SHA1 Message Date
Michael Eischer 0753dbb622
Merge a1d682ce0e into 24c1822220 2024-05-04 14:35:15 +02:00
Michael Eischer 24c1822220
Merge pull request #4794 from flow-c/master
Update 060_forget.rst
2024-05-04 08:25:06 +00:00
flow-c d4477a5a99
Update 060_forget.rst
Replace deprecated `-1` with `unlimited` in calendar-related `--keep-*` options
2024-05-04 09:32:25 +02:00
Michael Eischer a1d682ce0e add changelog for sftp performance fix 2024-04-28 11:58:08 +02:00
Michael Eischer 935327d480 sftp: slightly increase write concurrency
This should increase upload throughput for high latency links a bit.
2024-04-28 11:50:09 +02:00
Michael Eischer 669a669603 sftp: Fix upload performance issue
Since pkg/sftp 1.13.0 files were uploaded sequentially using 32kb chunks
instead of sending 64 chunks in parallel.
2024-04-28 11:48:26 +02:00
3 changed files with 15 additions and 3 deletions

View File

@ -0,0 +1,7 @@
Bugfix: Fix slow sftp upload performance
Since restic 0.12.1, the upload speed of the sftp backend to a remote server
has regressed significantly. This has been fixed.
https://github.com/restic/restic/issues/4209
https://github.com/restic/restic/pull/4782

View File

@ -205,7 +205,7 @@ The ``forget`` command accepts the following policy options:
natural time boundaries and *not* relative to when you run ``forget``. Weeks
are Monday 00:00 to Sunday 23:59, days 00:00 to 23:59, hours :00 to :59, etc.
They also only count hours/days/weeks/etc which have one or more snapshots.
A value of ``-1`` will be interpreted as "forever", i.e. "keep all".
A value of ``unlimited`` will be interpreted as "forever", i.e. "keep all".
.. note:: All duration related options (``--keep-{within-,}*``) ignore snapshots
with a timestamp in the future (relative to when the ``forget`` command is

View File

@ -102,7 +102,12 @@ func startClient(cfg Config) (*SFTP, error) {
}()
// open the SFTP session
client, err := sftp.NewClientPipe(rd, wr)
client, err := sftp.NewClientPipe(rd, wr,
// write multiple packets (32kb) in parallel per file
// not strictly necessary as we use ReadFromWithConcurrency
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)
}
@ -359,7 +364,7 @@ func (r *SFTP) Save(_ context.Context, h backend.Handle, rd backend.RewindReader
}()
// save data, make sure to use the optimized sftp upload method
wbytes, err := f.ReadFrom(rd)
wbytes, err := f.ReadFromWithConcurrency(rd, 0)
if err != nil {
_ = f.Close()
err = r.checkNoSpace(dirname, rd.Length(), err)