Limiting syncthing's CPU load

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.

Great, exactly what I need. I only searched the settings, so sorry for that.

I’ve got an alternative solution on the mac using ‘cputhrottle’ available from brew.

Install cputhrottle brew install cputhrottle Create the following script

#!/usr/bin/env bash
SYNC_THING_ID=`ps -A | grep -m1 syncthing | awk '{print $1}'`
sudo cputhrottle $SYNC_THING_ID 10 &

Change the 10 there to suit your needs, it is the CPU % use.

you have to run this everytime you want to throttle syncthing, currently researching a permanent solution.

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.

Google how to set environment variables on your OS. You can also adjust syncthings priority in the task manager, by rightclicking on process.

If you’re using SyncTrayzor, that also had a setting to set Syncthing’s CPU priority.