FileSystemWatcher or polling in a constantly changing folder

I use Syncthing to share files during the build process of a rather large software image to several machines. After the build is done and the syncing is completed the folder is unshared on Syncthing.

Since the build contains about 300 000 files and 90GB of data the scanning process takes a while.

I am not sure which interval should be set in this case. Currently it is set to scan every 60s, but a scan definitely takes longer. As far as I understand the file system watcher should be no help in my scenario, since changes appear constantly and therefore it would just activate constant scanning.

Is there any recommended setting for this situation?

Yes, the watcher should also help in your scenario: Instead of stating every file every minute and hashing new files, you would only stat and hash new files with watching. If the generation of a single file takes longer than 1mim (as in the time between the file first appearing and being modified the last time), you want to increase the watcher delay, to avoid hashing files twice.

Ok, that sounds promising. Of course I get the error message that i should increase the inotify limits. I will look into this, if I can do it without decreasing perfomance.

1 Like

Depending on your build process, you could also tell syncthing to scan a specific file/folder via API after you are done with it.

I think this is unfortunately not manageable in a reasonable amount of time since it is quite a big software collaboration.

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