Rclone uses hundreds of gigabytes for cache while vfs-cache-max-size is 0.1G

STOP and READ USE THIS TEMPLATE NO EXCEPTIONS - By not using this, you waste your time, our time and really hate puppies. Please remove these two lines and that will confirm you have read them.

What is the problem you are having with rclone?

My root partition's usage was 100% because of rclone cache. Cache is too big. Am I understanding the flag wrong? What flag should I use?

Run the command 'rclone version' and share the full output of the command.

rclone v1.65.0

  • os/version: arch (64 bit)
  • os/kernel: 6.1.71-1-lts (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.21.4
  • go/linking: dynamic
  • go/tags: none

Which cloud storage system are you using? (eg Google Drive)

OneDrive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

ExecStart= \
  /usr/bin/rclone mount \
    --config=%h/.config/rclone/rclone.conf \
    --vfs-cache-mode writes \
    --vfs-cache-max-size 100M \
    --log-level INFO \
    --log-file /tmp/rclone-%i.log \
    --umask 022 \
    --allow-other \
    %i: %h/mnt/%i

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[onedrive-****]
type = onedrive
token = XXX
drive_id = XXX
drive_type = business
### Double check the config for sensitive info before posting publicly

A log from the command that you were trying to run with the -vv flag

I didn't save the log and I lost access to the log.

There could be many reasons. In general as per docs:

If using --vfs-cache-max-size or --vfs-cache-min-free-size note that the cache may exceed these quotas for two reasons. Firstly because it is only checked every --vfs-cache-poll-interval. Secondly because open files cannot be evicted from the cache. When --vfs-cache-max-size or --vfs-cache-min-free-size is exceeded, rclone will attempt to evict the least accessed files from the cache first. rclone will start with files that haven't been accessed for the longest. This cache flushing strategy is efficient and more relevant files are likely to remain cached.

For example in your case you set max cache size to 100M. But if you copy to mount 1G file this is how much cache will be used - 1G. This file will be cached for writes. After transfer to cloud is finished rclone will try delete as many files as needed to get back to 100M cache size.

rclone tries to keep cache within set limits - but if you throw at it too much then there is nothing rclone can do.

I think good advice is to set cache size bigger than biggest files you work with.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.