Syncthing is very CPU hungry and it seems to bother users. If a lot of data changes in a short period of time it can get pretty sticky.
That’s why I’m looking for a way to “Syncthing” automatically up and down depending on the time. This could be used to postpone the synchronization to the night if it doesn’t bother anyone.
The best thing would be a feature that automatically pauses Syncthing at a certain time, and after a certain time the pause is canceled again. That would solve the problem.
I use Syncthing together with the “nssm”.
Perhaps there is also a method how to switch the service on and off with nssm depending on the time. But I have not found a way to operate nssm time-controlled.
Can someone give me some ideas on this? How do you do this ?
You can easily switch services on and off using Task Scheduler. There is no specific guide for doing it for NSSM, but you can find basic instructions on how to set up a new task under https://docs.syncthing.net/users/autostart.html#autostart-windows-taskschd. Of course, specific commands and triggers will differ, but those you will likely need to figure out and customise to your needs. The built-in command to manage services is Windows is sc (or the old net).
I would actually rather suggest to run Syncthing with idle priority. This way Windows will simply prevent the syncthing.exe process from affecting other system resources. This can be done easily when launching the process from command line with start /low syncthing.exe (or in the XML file when using Task Scheduler). NSSM seems to have a specific setting to change process priority too.
If you do go this route though, then you must also disable Set Low Priority in the Advanced Configuration (see https://github.com/syncthing/syncthing/issues/6597). On a side note, this setting changes only CPU priority, while in my experience the key is to lower I/O priority together with it, as Syncthing is extremely I/O hungry when scanning. On the other hand, the aforementioned command line and Task Scheduler methods lower both CPU, I/O and RAM priorities.
I personally run Syncthing like that even on an old Intel Atom based Windows tablet, and have yet to experience any slowdowns because of it, even when processing a lot of data. Windows really does a pretty good with preventing low-priority processes from affecting system responsiveness.