docs/sftp: document use of chunk_size option in sftp remote paired with serve sftp

Related to 0008cb4934
This commit is contained in:
albertony 2022-08-30 19:51:00 +02:00
parent ce3b65e6dc
commit 35349657cd
2 changed files with 20 additions and 15 deletions

View file

@ -275,19 +275,24 @@ Set to 0 to keep connections indefinitely.
Name: "chunk_size", Name: "chunk_size",
Help: `Upload and download chunk size. Help: `Upload and download chunk size.
This controls the maximum packet size used in the SFTP protocol. The This controls the maximum size of payload in SFTP protocol packets.
RFC limits this to 32768 bytes (32k), however a lot of servers The RFC limits this to 32768 bytes (32k), which is the default. However,
support larger sizes and setting it larger will increase transfer a lot of servers support larger sizes, typically limited to a maximum
speed dramatically on high latency links. total package size of 256k, and setting it larger will increase transfer
speed dramatically on high latency links. This includes OpenSSH, and,
for example, using the value of 255k works well, leaving plenty of room
for overhead while still being within a total packet size of 256k.
Only use a setting higher than 32k if you always connect to the same Make sure to test thoroughly before using a value higher than 32k,
server or after sufficiently broad testing. and only use it if you always connect to the same server or after
sufficiently broad testing. If you get errors such as
For example using the value of 252k with OpenSSH works well with its "failed to send packet payload: EOF", lots of "connection lost",
maximum packet size of 256k. or "corrupted on transfer", when copying a larger file, try lowering
the value. The server run by [rclone serve sftp](/commands/rclone_serve_sftp)
If you get the error "failed to send packet header: EOF" when copying sends packets with standard 32k maximum payload so you must not
a large file, try lowering this number. set a different chunk_size when downloading files, but it accepts
packets up to the 256k total size, so for uploads the chunk_size
can be set as for the OpenSSH example above.
`, `,
Default: 32 * fs.Kibi, Default: 32 * fs.Kibi,
Advanced: true, Advanced: true,

View file

@ -71,9 +71,9 @@ The server will respond to a small number of shell commands, mainly
md5sum, sha1sum and df, which enable it to provide support for checksums md5sum, sha1sum and df, which enable it to provide support for checksums
and the about feature when accessed from an sftp remote. and the about feature when accessed from an sftp remote.
Note that this server uses fixed 32 KiB packet size, which means you must not Note that this server uses standard 32 KiB packet payload size, which
configure the client to use any other values, e.g. with the means you must not configure the client to expect anything else, e.g.
[chunk_size](/sftp/#sftp-chunk-size) option on an sftp remote. with the [chunk_size](/sftp/#sftp-chunk-size) option on an sftp remote.
The server will log errors. Use ` + "`-v`" + ` to see access logs. The server will log errors. Use ` + "`-v`" + ` to see access logs.