Is disk based dir cache enabled by default now or is it still just in RAM?

I was curious about dir cache time surviving across reboots and saw this post from Nick back in 2020. Was this implemented and is it the default process now to save the dir cache to disk or does that have to be enabled?

I currently do a vfs/refresh after starting systemd but I have noticed that sometimes if I check a few hours later the directories have not been cached. I tested this by doing a "find ." in a folder with lots of subfolders and if its cached it completes after 1-2 seconds and if not I can see it traversing through the folders. As a workaround I added a cronjob to do a vfs/refresh 120 secodns after @reboot. That seems to be doing the job but if I could write the dir-cache to disk so that a vfs/refresh is not needed at all that would be better again.

ExecStartPost=/usr/bin/rclone rc vfs/refresh recursive=true --rc-addr _async=true

nope - not yet

You can use --vfs-refresh flag instead nowadays. It does the same. Make sure you are using the latest rclone though.

Please note that dirs' cache is only valid for 5 minutes by default. You can change it using --dir-cache-time flag. For remotes I only access using mount I use 9999h

Thanks I was not aware of the --vfs-refresh flag :slight_smile: I will try that . My --dir-cache-time value is set to 9999h

I hope backing up the dir cache to disk and reading it into RAM on reboot is added. Most of my services looking at the mount are scanning those folders which slows them all down so I usually have them on a delayed startup to allow the disk cache to be peformed.

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