I’ve been getting the inotify handler error on arch based systems and synology systems with the same sync.
I increased the inotify limits to 576000 but maybe im misunderstanding it a bit. the error keeps returning.
the fixes here in the FAQ — Syncthing documentation didnt work but is the value suposed to be larger then the files and folders you are syncing?
In my understanding its just changing the allowed value for syncthing or anyone really on the machine for how many files and folders it can keep track of at the same time. and on linux this is limited for some reason.
My question is what value should i pick if im syncing over 10 million files across 2 million folders? Should i turn off watch for changes and if i turn that off will i miss any features dependent on that?
Ideally, max_user_watches should be at least as high as the sum of all directories and files watched by every process run per user (e.g. Syncthing, desktop environment, Firefox,…).
Some Linux distros set the default limit quite low, but it also shouldn’t be arbitrarily high because each watch requires a slot in the inotify queue, and a slot consumes 1,080 bytes, so fs.inotify.max_user_watches=1000000 would eat up ~1GB of RAM (e.g. 50% of a Synology DS223’s stock RAM).
(Note, some Linux distros use zram to compress data, so actual memory usage might be quite a bit smaller.)
inotify watches aren’t recursive, so each directory and its contents require individual watches, so fs.inotify.max_user_watches=12100000 would be a reasonable number with enough slack to accommodate other processes that also require watches.
If watching for changes is turned off, Syncthing will rely on its full rescan interval to detect changes. Depending on how often the files change and how fast the storage media is, it might be okay.