From fe880c0fac19da429bf80648b2c83eb484cacde3 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 6 May 2025 15:23:13 +0100 Subject: [PATCH] docs: move --max-connections documentation to the correct place --- docs/content/docs.md | 26 ++++++++++++++++++++++++++ fs/config.go | 26 +++----------------------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/docs/content/docs.md b/docs/content/docs.md index 483c748a2..a8f1f4082 100644 --- a/docs/content/docs.md +++ b/docs/content/docs.md @@ -1557,6 +1557,32 @@ Setting `--max-buffer-memory` allows the buffer memory to be controlled so that it doesn't overwhelm the machine and allows `--transfers` to be set large. +### --max-connections=N ### + +This sets the maximum number of concurrent calls to the backend API. +It may not map 1:1 to TCP or HTTP connections depending on the backend +in use and the use of HTTP1 vs HTTP2. + +When downloading files, backends only limit the initial opening of the +stream. The bulk data download is not counted as a connection. This +means that the `--max--connections` flag won't limit the total number +of downloads. + +Note that it is possible to cause deadlocks with this setting so it +should be used with care. + +If you are doing a sync or copy then make sure `--max-connections` is +one more than the sum of `--transfers` and `--checkers`. + +If you use `--check-first` then `--max-connections` just needs to be +one more than the maximum of `--checkers` and `--transfers`. + +So for `--max-connections 3` you'd use `--checkers 2 --transfers 2 +--check-first` or `--checkers 1 --transfers 1`. + +Setting this flag can be useful for backends which do multipart +uploads to limit the number of simultaneous parts being transferred. + ### --max-delete=N ### This tells rclone not to delete more than N files. If that limit is diff --git a/fs/config.go b/fs/config.go index 4f6c4dad2..e8f0dee8c 100644 --- a/fs/config.go +++ b/fs/config.go @@ -545,31 +545,11 @@ var ConfigOptionsInfo = Options{{ Help: "Add partial-suffix to temporary file name when --inplace is not used", Groups: "Copy", }, { - Name: "max_connections", - Help: strings.ReplaceAll(`Maximum number of simultaneous connections, 0 for unlimited. - -This sets the maximum number of connections made to the backend on a -per backend basis. Connections in this case are calls to the backend -API and may not map 1:1 to TCP or HTTP connections depending on the -backend in use. - -Note that it is possible to cause deadlocks with this setting so it -should be used with care. - -If you are doing a sync or copy then make sure |--max-connections| is -one more than the sum of |--transfers| and |--checkers|. - -If you use |--check-first| then |--max-connections| just needs to be -one more than the maximum of |--checkers| and |--transfers|. - -So for |--max-connections 3| you'd use |--checkers 2 --transfers 2 ---check-first| or |--checkers 1 --transfers 1|. - -Setting this flag can be useful for backends which do multipart -uploads or downloads to limit the number of total connections. -`, "|", "`"), + Name: "max_connections", + Help: "Maximum number of simultaneous backend API connections, 0 for unlimited.", Default: 0, Advanced: true, + Groups: "Networking", }} // ConfigInfo is filesystem config options