What is the problem you are having with rclone?
Low performance accessing rclone mount with a custom database-like application; the mount has a single directory with a few dozens of files, each file some scores of gigabytes, and each access by the application (as seen with strace) consists of read-only opening one of the files, then a series of (1 x lseek plus 1, 2 or 3 x 8KB reads, then a close:
strace -tt -T -e openat,read,write,lseek,close -f -p $APP_PID
16851 12:51:04.232424 openat(AT_FDCWD, "/REDACTED/REDACTED.dat", O_RDONLY) = 14 <0.001610>
16851 12:51:04.234406 lseek(14, 107510362295, SEEK_SET) = 107510362295 <0.000037>
16851 12:51:04.234616 read(14, "REDACTED"..., 8191) = 8191 <0.003660>
16851 12:51:04.238828 read(14, "REDACTED"..., 8191) = 8191 <0.001021>
16851 12:51:04.240991 read(14, "REDACTED"..., 8191) = 8191 <0.000142>
16851 12:51:04.241335 lseek(14, 108183601375, SEEK_SET) = 108183601375 <0.000041>
16851 12:51:04.241466 read(14, "REDACTED"..., 8191) = 8191 <1.556332>
16851 12:51:05.798263 lseek(14, 99049494583, SEEK_SET) = 99049494583 <0.000016>
16851 12:51:05.798454 read(14, "REDACTED"..., 8448) = 8448 <1.513859>
16851 12:51:07.312511 lseek(14, 81231850168, SEEK_SET) = 81231850168 <0.000015>
16851 12:51:07.312701 read(14, "REDACTED"..., 8191) = 8191 <1.534364>
16851 12:51:08.847264 read(14, "REDACTED"..., 8191) = 8191 <0.000734>
16851 12:51:08.865650 lseek(14, 63848342743, SEEK_SET) = 63848342743 <0.000029>
16851 12:51:08.866082 read(14, "REDACTED"..., 8191) = 8191 <1.521446>
16851 12:51:10.387820 read(14, "REDACTED"..., 8191) = 8191 <0.002077>
16851 12:51:10.390326 lseek(14, 45966850468, SEEK_SET) = 45966850468 <0.000063>
16851 12:51:10.390527 read(14, "REDACTED"..., 8191) = 8191 <1.396265>
16851 12:51:11.787305 read(14, "REDACTED"..., 8191) = 8191 <0.000508>
16851 12:51:11.788221 lseek(14, 31801455043, SEEK_SET) = 31801455043 <0.000032>
16851 12:51:11.788379 read(14, "REDACTED"..., 8191) = 8191 <1.803120>
16851 12:51:13.591752 read(14, "REDACTED"..., 8191) = 8191 <0.002589>
16851 12:51:13.594805 lseek(14, 21270188518, SEEK_SET) = 21270188518 <0.000018>
16851 12:51:13.594932 read(14, "REDACTED"..., 8191) = 8191 <1.420962>
16851 12:51:15.016178 read(14, "REDACTED"..., 8191) = 8191 <0.000354>
16851 12:51:15.016813 lseek(14, 6584599198, SEEK_SET) = 6584599198 <0.000021>
16851 12:51:15.016941 read(14, <unfinished ...>
16851 12:51:16.428064 <... read resumed> "REDACTED"..., 8191) = 8191 <1.411070>
16851 12:51:16.428286 read(14, "REDACTED"..., 8191) = 8191 <0.000520>
16851 12:51:16.429140 close(14) = 0 <0.000317>
The problem (as you can see by the syscall times between angle brackets at the end of each line) is that the first read after the lseek takes around 1.5 seconds; I need to optimize the mount so it takes as little as possible, ideally less than 0.2s.
The machine running rclone mount
and the application is not in any way overloaded, has a very fast/low latency 100Mbps connection to the Internet, which results in under 5ms ping time to the Google Drive servers rclone mount
has connected to (which I have identified by using netstat -nap | grep rclone | grep ESTABLISHED
).
Thanks in advance to everyone!
Cheers,
-- Durval.
What is your rclone version (output from rclone version
)
rclone v1.55.1
- os/type: linux
- os/arch: amd64
- go/version: go1.16.3
- go/linking: static
- go/tags: none
Which OS you are using and how many bits (eg Windows 7, 64 bit)
Linux Devuan Beowulf (systemd-less Debian 10 Buster equivalent)
Which cloud storage system are you using? (eg Google Drive)
Encrypted Google Drive
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
rclone --rc --rc-addr=127.0.0.1:55720 --dir-cache-time=100000h \
--vfs-cache-max-age=100000h --poll-interval=15s \
--cache-dir=/REDACTED/rclone_mount_cache --vfs-cache-mode=full \
--vfs-cache-max-size=50G --buffer-size=8k --vfs-read-ahead=8k \
--vfs-read-chunk-size=16k --vfs-read-chunk-size-limit=off --read-only \
--user-agent RANDOM_STRING mount REDACTED:REDACTED /REDACTED
The rclone config contents with secrets removed.
[REDACTED]
type = crypt
remote = REDACTED2:REDACTED/REDACTED
filename_encryption = standard
directory_name_encryption = true
password = REDACTED
[REDACTED2]
type = drive
client_id = REDACTED.apps.googleusercontent.com
client_secret = REDACTED
service_account_file =
token = {"access_token":"REDACTED","token_type":"Bearer","refresh_token":"REDACTED","expiry":"2021-05-05T16:53:45.204740176Z"}
root_folder_id = REDACTED
A log from the command with the -vv
flag
-v -v
output is really monstrous, and as it's not really a bug but rather a performance problem, I think the strace above should suffice -- if not, please tell me what you need, preferably in a way I can set into a running rclone via rclone rc
.