Attribute caching | --attr-timeout

Attached at bottom is blurb regarding attribute caching.

I have a mount that is read-only. New files will appear on the mount, however, once appeared, they will never change or be modified. From my understanding after reading below, that means theres no chance of file corruption.

If you set it higher (10s or 1m say) then the kernel will call back to rclone less often making it more efficient

It looks like then i should configure a higher time than the default 1s after reading above. How does it make it more efficient? Is it worth me putting this at 1m (or even 1hr?.. idk lol). What kinds of benefit's should i expect here?

Attribute caching

You can use the flag --attr-timeout to set the time the kernel caches the attributes (size, modification time, etc.) for directory entries.

The default is 1s which caches files just long enough to avoid too many callbacks to rclone from the kernel.

In theory 0s should be the correct value for filesystems which can change outside the control of the kernel. However this causes quite a few problems such as rclone using too much memory, rclone not serving files to samba and excessive time listing directories.

The kernel can cache the info about a file for the time given by --attr-timeout. You may see corruption if the remote file changes length during this window. It will show up as either a truncated file or a file with garbage on the end. With --attr-timeout 1s this is very unlikely but not impossible. The higher you set --attr-timeout the more likely it is. The default setting of "1s" is the lowest setting which mitigates the problems above.

If you set it higher (10s or 1m say) then the kernel will call back to rclone less often making it more efficient, however there is more chance of the corruption issue above.

If files don't change on the remote outside of the control of rclone then there is no chance of corruption.

This is the same as setting the attr_timeout option in mount.fuse.

You'll most likely never notice any real impact from changing it. I'd leave it at the default.

Thanks for the input :slight_smile: leaving at default

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