How long is the cache available on the disk?

Guys, good night.
I have a question that may be bullshit for all of you and I believe that you will answer with all certainty.

I always used rclone without cache, everything always in RAM.
But now I am testing the disk cache to check the performance and I am in doubt how the cache behaves, and how long it will be available on the disk.

Below is my cache configuration inside .config

[cache]
type = cache
remote = gdrive:
chunk_size = 10M
info_age = 1h
chunk_path = /mnt/Cache/rclone
db_path = /mnt/Cache/db
chunk_total_size = 30G
rps = 10
workers = 4

These are the flags I use in my service.

--allow-other
--allow-non-empty
--cache-dir / mnt/Cache/vfs
--drive-skip-gdocs
--poll-interval 1m
--vfs-cache-max-age 720h
--vfs-cache-mode writes
--vfs-cache-poll-interval 1m
--vfs-cache-max-size off
--vfs-read-chunk-size 16M
--vfs-read-chunk-size-limit 1G
--gid = 1000
--uid = 1000
--umask 002
--fast-list
--log-file /opt/cache-rclone.log
--log-level INFO
--cache-chunk-no-memory = true

My doubts are:

  1. Is the --vfs-cache-max-age 720h flag the time the cache will be on disk, or is it only valid for RAM?
  2. The disk cache, if there is nothing configured, it will remain there forever until it is replaced by new files, respecting the determined size (in this case I put it to 30GB)

You have two caches going on.

The cache backend is one thing and that is keeping your reads cached in chunks on disk. That's based on size of your chunk totals and it removes once the chunk size hits it's max size.

This is for your writes to disk and this is based on as you stated, "vfs-cache-max-age 720h" so it stays on disk for 720 hours. This has zero relation/impact on anything for the cache backend as they are independent of each other.

It depends on what cache you mean as you have two going on.

The cache backend works on size and you have 30GB configured with chunk_total_size = 30G.
The vfs-cache backend works on time as you have vfs-cache-max-size off so there is no max size for it.

This rclone montage I use only for reproduction in Plex, I do not have files being sent to the assembly.
My intention would be to leave as long as possible a file that has already been watched on Plex in the disk cache so that if someone comes to watch the same content it will be played directly from the disk, without having to download it again. In this case, this is the function of cache mode, correct?

I left the info_age in 1h because in some tests that I did with a very long time, when my seedbox sent new contents to my drive, Plex when I was going to perform the scan he ignored this new file, and the impression I had is that it scanned only what was saved in the db.

When you say I have two caches in progress, one is the cache of the chunks, correct? Does this have a predetermined life span? In my view, they will only be replaced when new files are played on Plex, but the disk size will always remain at what I determined (30GB), am I wrong?

What would be the other cache I have configured?

Sorry for my silly doubts.

You are using the cache backend:

https://rclone.org/cache/

and you are using the write caching with the stock vfs backend.

https://rclone.org/commands/rclone_mount/#file-caching

There are separate from each other and have their own specific options and configuration.

If you just reading files, you are primarily using the cache backend you have configured. That uses chunks and operates based total size and info age as you have those options configured. Those allow the same content to be read from 'chunks' that you keep on disk.

The separate vfs backend 'write' mode cache you have setup operates based on size and time as well, but those are different options that you have setup.

These are cache backend options and items only stay for 1 hour and a max of 30GB based on your setup.

These are the VFS cache mode write options and they stay for 720 hours and have no limit on size based on your options.

Now things are starting to make sense to me.
As I said, in some tests I did, keeping the info_age at 72h for example, when some new content was sent to the drive, and even if I did a manual scan on Plex, it scanned all folders very fast and the new one was not found content, as if ignoring anything that was new on google and reading only what was on disk. I don't know if this is the right behavior

In my case, I use the rclone only for playback on Plex, and I want to use the disk cache mode, keeping what was watched as long as possible until new content is played and replaces what is recorded, I better use it which option?

That's not normal as new content would be picked up via polling.

I don't use the cache backend at all nor do I write to my rclone mount as I use a union mergerfs setup. For playback, you don't need the cache remote backend.

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