First of all, I’m new to syncthing and so far it is a great tool. Really good job by the programmers. One thing though I noticed, is the high CPU load, that makes my laptop sometimes unusable, when files are scaned or synced. The problem I see is, that syncthing uses all cores to perform tasks as fast as possible. This makes sometimes working with the computer impossible.
For me, syncthing should be a background service, so going unnoticed. For that, it can be work more slowly as possible, as long as it does not disturbe me working on the pc. I don’t mind if the sync takes 1min or 10mins, if I can still use my computer in that time.
So my suggestion is to add an option to limit the CPU load or just to limit syncthing to sequential, using only one core, so it behaves more like a background service.
Once more, I am new, so I have no idea about the code and technical stuff. This is only an idea, that I think, would be worth a discussion.
There’s an environment variable that can be set, GOMAXPROCS (details in syncthing -help). Setting it under Windows is a bit unintuitive and annoying probably, but it is used to limit the number of CPU cores used.
Where do I find these environment variables on Windows 7? I checked the help but it only states what the variables do and not where to find the variables.
It’s specified via a shell environment, so if you were to launch Syncthing from a command-line on macOS (and Linux):
export GOMAXPROCS=2 ; syncthing
The environment variable can also be set so that it applies when macOS / Linux boots up so that it’s available any time no matter how Syncthing is launched.
The Syncthing app bundle for macOS is a nice slim wrapper plus the Syncthing executable (directly from GitHub). Generally speaking, environment variables are visible to all applications.
There are several different ways to set an environment variable, but to avoid conflicts and for flexibility given the goal, setting it via your login profile is a good place.
You didn’t mention which version of macOS, so first find out what your login shell is. To see all current environment variables that have been defined, use the following command:
env
To see just the one that indicates your login shell:
echo $SHELL
If you’re using Z shell (/bin/zsh), update ~/.zprofile. If it’s Bash (/bin/bash), update ~/.bash_profile.
For full effect, log off and log back on.
It’s really a macOS question, so Googling for “macOS shell” would be a better option.