Besides limiting the scanning rate, is there any way to limit the CPU usage? Powertop always shows syncthing as the top power consumption process. This is important in case of using a laptop on battery (no AC). If this feature isn’t available, is it possible to plug in this feature in the current architecture of syncthing?
Syncthing keeps active network connections, so there is some chatter like pings going back and forth every now and then, and some threads poll for updates every few seconds. That said, Syncthing on my laptop averages 0.0% CPU when not scanning - the rest of the usage is hidden in the decimals. I’m not sure what your Syncthing is doing to use much more than that? Do you have the web GUI open or one of the tray applications? These would subscribe to events and drive up the usage somewhat…
Yesterday I also noted that while on battery power, checking powertop puts syncthing in one of the top processes that consume energy. I understand that cpu usage is somewhere between 0-1%, with most of the times 0.0x% but it still generates CPU interrupts and makes the CPU to wake up from the power saving states. As a comparison it sits above firefox process which was minimized or in background.
I can guarantee that syncthing was just standing there without anything to do and I closed the web GUI just to prevent any kind of communication between web page and the process. I came here today to open a topic about this, and found this one.
It would be nice to optimize syncthing at least when in battery power if not always. I mean it is already not bad, it’s not that it consumes a lot of power, it is comparable with some ubuntu indicators which show cpu/fan status in the tray every second, but still from what powertop says there is space for improvement.
Later I could provide some screenshots if you are interested, but if you have powertop is easy to check.
There are probably some things that could be moved from polling to be event triggered instead, which would help. Do note though that having the GUI up (or an app that polls the REST API to provide status and notifications) drives up the CPU usage rather a lot.
powertop.html (74.8 KB)
Here is my powertop report (listened for pc events during 20 seconds).
Syncthing generates around 15-20 wakeups/second, the cpu usage is 0.0-0.1%. From time to time it generates 50 wakeups/second (maybe it is scanning)
As you can see from the report it uses as much energy as my icons (ubuntu indicators) near the clock showing cpu temp, fan speed and cpu usage graph which is refreshed every second.
It is not much energy but I guess it is worth noting so that it can be improved or at least some care can be taken when coding parts of the application which could raise cpu wakeups.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.