What is the problem you are having with rclone?
I am using SFTP backend to syncronize folders and as restic backend for my backups. Everything works fine (this setup is running for years) but seems that rclone is opening a lot less connections than expected, and this is limiting the bandwidth usage.
Run the command 'rclone version' and share the full output of the command.
rclone v1.63.1
- os/version: freebsd 13.2-release-p1 (64 bit)
- os/kernel: 13.2-release-p1 (amd64)
- os/type: freebsd
- os/arch: amd64
- go/version: go1.20.6
- go/linking: static
- go/tags: none
Which cloud storage system are you using? (eg Google Drive)
SFTP toward a dedicated remote machine
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
Two different commands are used to reproduce the issue:
rclone sync -P --transfers 10 -vv /store/video/anime/Gordian remote:/store/tmp/Gordian
restic backup --files-from filelist.txt -o rclone.connections=10
that in turn executes
rclone serve restic --stdio --b2-hard-delete remote:/store/tmp/restic
The rclone config contents with secrets removed.
[remote]
type = sftp
host = remote.host
key_file = /root/.ssh/id_ed25519
shell_type = unix
md5sum_command = md5sum
sha1sum_command = sha1sum
A log from the command with the -vv
flag
When using rclone sync:
2023/07/24 12:34:15 DEBUG : rclone: Version "v1.63.1" starting with parameters ["rclone" "sync" "-P" "--transfers" "10" "-vv" "/store/video/anime/Gordian" "remote:/store/tmp/Gordian"]
2023/07/24 12:34:15 DEBUG : Creating backend with remote "/store/video/anime/Gordian"
2023/07/24 12:34:15 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2023/07/24 12:34:15 DEBUG : Creating backend with remote "remote:/store/tmp/Gordian"
2023/07/24 12:34:16 DEBUG : sftp://root@remote:22//store/tmp/Gordian: New connection 10.0.0.2:51943->x.x.x.x:22 to "SSH-2.0-OpenSSH_9.3 FreeBSD-20230316"
2023/07/24 12:34:16 DEBUG : sftp://root@remote:22//store/tmp/Gordian: Shell type "unix" from config
2023/07/24 12:34:16 DEBUG : sftp://root@remote:22//store/tmp/Gordian: Using root directory "/store/tmp/Gordian"
[chekers lines removed]
2023-07-24 12:34:16 DEBUG : sftp://root@remote:22//store/tmp/Gordian: Waiting for checks to finish
2023-07-24 12:34:16 DEBUG : sftp://root@remote:22//store/tmp/Gordian: Waiting for transfers to finish
2023-07-24 12:34:16 DEBUG : sftp://root@remote:22//store/tmp/Gordian: New connection 10.0.0.2:46459->x.x.x.x:22 to "SSH-2.0-OpenSSH_9.3 FreeBSD-20230316"
2023-07-24 12:34:17 DEBUG : sftp://root@remote:22//store/tmp/Gordian: New connection 10.0.0.2:31240->x.x.x.x:22 to "SSH-2.0-OpenSSH_9.3 FreeBSD-20230316"
2023-07-24 12:34:17 DEBUG : sftp://root@remote:22//store/tmp/Gordian: New connection 10.0.0.2:18421->x.x.x.x:22 to "SSH-2.0-OpenSSH_9.3 FreeBSD-20230316"
Transferred: 1.255 GiB / 21.058 GiB, 6%, 25.073 MiB/s, ETA 13m28s
Errors: 2 (retrying may help)
Transferred: 2 / 74, 3%
Elapsed time: 49.1s
Transferring:
* Gordian - s01e02 - L'i…o con Saori [576p].mkv: 26% /293.903Mi, 1.321Mi/s, 2m43s
* Gordian - s01e03 - Il …serto rosso [576p].mkv: 37% /296.045Mi, 1.964Mi/s, 1m34s
* Gordian - s01e01 - Daigo [576p].mkv: 37% /295.907Mi, 1.954Mi/s, 1m35s
* Gordian - s01e04 - La …gente sacra [576p].mkv: 36% /296.622Mi, 1.943Mi/s, 1m36s
* Gordian - s01e05 - La …della morte [576p].mkv: 58% /295.846Mi, 3.553Mi/s, 34s
* Gordian - s01e06 - Una…Victor City [576p].mkv: 25% /295.298Mi, 1.279Mi/s, 2m53s
* Gordian - s01e07 - Il …reto di Gen [576p].mkv: 25% /295.154Mi, 1.298Mi/s, 2m49s
* Gordian - s01e08 - L'a…di Mukadeck [576p].mkv: 26% /294.991Mi, 1.315Mi/s, 2m45s
* Gordian - s01e10 - Capo Naso Rosso [576p].mkv: 51% /294.916Mi, 3.590Mi/s, 40s
* Gordian - s01e11 - Gli… reggimento [576p].mkv: 0% /294.641Mi, 0/s, -
A similar behaviour when using restic:
rclone: 2023/07/24 12:22:07 DEBUG : rclone: Version "v1.63.1" starting with parameters ["rclone" "serve" "restic" "--stdio" "--b2-hard-delete" "remote:/store/tmp/restic"]
rclone: 2023/07/24 12:22:07 DEBUG : Creating backend with remote "remote:/store/tmp/restic"
rclone: 2023/07/24 12:22:07 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
rclone: 2023/07/24 12:22:07 DEBUG : sftp://root@remote:22//store/tmp/restic: New connection 10.0.0.2:29974->x.x.x.x:22 to "SSH-2.0-OpenSSH_9.3 FreeBSD-20230316"
rclone: 2023/07/24 12:22:07 DEBUG : sftp://root@remote:22//store/tmp/restic: Shell type "unix" from config
rclone: 2023/07/24 12:22:07 DEBUG : sftp://root@remote:22//store/tmp/restic: Using root directory "/store/tmp/restic"
rclone: 2023/07/24 12:22:07 DEBUG : file-11047155567684542504: GET request error: object not found
rclone: 2023/07/24 12:22:07 DEBUG : keys: list request
rclone: 2023/07/24 12:22:08 DEBUG : locks: list request
rclone: 2023/07/24 12:22:09 DEBUG : locks: list request
rclone: 2023/07/24 12:22:09 DEBUG : snapshots: list request
rclone: 2023/07/24 12:22:09 DEBUG : index: list request
rclone: 2023/07/24 12:22:16 DEBUG : sftp://root@remote:22//store/tmp/restic: New connection 10.0.0.2:51118->x.x.x.x:22 to "SSH-2.0-OpenSSH_9.3 FreeBSD-20230316"
rclone: 2023/07/24 12:23:07 INFO : total 7368 files 38.080 GiB, 0 errors ETA 22:25
rclone: Transferred: o 1.010 GiB / 1.255 GiB, 81%, 18.761 MiB/s, ETA 13s
rclone: Transferred: 3 / 13, 23%c_012662.png
rclone: Elapsed time: 1m0.5s
rclone: Transferring:
rclone: * data/a9/a9d821815ccb80…7ae4241fdc44433e769121: 89% /128.550Mi, 1.982Mi/s, 6s
rclone: * data/a8/a8d1abfbc68104…e4096a901174195eb976ab: 88% /128.562Mi, 2.024Mi/s, 7s
rclone: * data/d7/d7750dc361bf23…332150ef34fd53429b0e8e: 80% /130.428Mi, 1.829Mi/s, 13s
rclone: * data/65/65cb8ec7e3847c…89a3e86cbf46614067cf08: 82% /128.239Mi, 1.971Mi/s, 11s
rclone: * data/cc/cc4153176cf2a6…2af1793dab96d7600c6a49: 79% /128.056Mi, 1.931Mi/s, 13s
rclone: * data/cc/ccbb314d9fffdd…ebe87eab2a0297c1bc10c8: 80% /128.668Mi, 2.030Mi/s, 12s
rclone: * data/5c/5cdc55ba53e842…92b7e3c26a3aeb5acc17a4: 78% /128.253Mi, 2.051Mi/s, 13s
rclone: * data/ce/ce445bdb8780c9…2d3d8dd2820bf79200586d: 75% /128.054Mi, 1.925Mi/s, 16s
rclone: * data/6d/6d550c57bfc030…37c9ada3004e8a5928b0ef: 75% /128.112Mi, 2.063Mi/s, 15s
rclone: * data/b3/b3921dce88769d…42c2608f20c886c0374b0b: 74% /128.197Mi, 2.005Mi/s, 16s
rclone:
rclone: 2023/07/24 12:29:39 DEBUG : sftp://root@remote:22//store/tmp/restic: Not closing 2 unused connections as 10 sessions active
As you can see, in both scenarios rclone report 10 concurrent uploads, which is correct, but there are much less concurrent connections as shown in the logs, and I can confirm running top
on the remote machine.
In restic scenario, I tried injecting RCLONE_TRANSFERS=10
into the environment, but nothing changes, probably this parameter is not even used in serve
command.
The sentence "Not closing 2 unused connections as 10 sessions active" may give some hint of what is happening.
Thank you for any help you can provide.