syncthing / syncthing-macos

Official frugal and native macOS Syncthing application bundle
https://syncthing.net
MIT License
2.68k stars 141 forks source link

Constant but low CPU usage of 0,5% on macOS Sonoma with Syncthing v1.27.3-1 #211

Open memeplex opened 7 months ago

memeplex commented 7 months ago

It seems strange to me that syncthing is always using some amount of CPU on my Mac, no matter if no other devices are connected or even if I stop the local service. The usage is low but never goes down to zero. There is no GUI components other than the icon at top bar. I've disabled the FS watcher for the only shared folder.

For example:

image
  1. No other device is connected.
  2. The local service is stopped (the top bar menu shows Unavailable).
  3. The web GUI is closed.
  4. Sync for the only shared folder was paused before stopping the service.

It's not a lot, but it's in the top-10 of %CPU on Activity Monitor open in an empty desktop for some minutes.

For an app that's doing nothing it seems a bit high. Weird at least.

Synthing 1.27.3-1 macOS Sonoma

memeplex commented 7 months ago

Interesting enough: when I enable the service, overall consumption as distributed between the windowed process and a couple of non-windowed ones that are now launched, adds up to more or less the same. After disabling the service again, the windowed process (shown in the previous screenshot) increases CPU usage.

xor-gate commented 5 months ago

Sorry for the late reply, but it is possible it always uses a little CPU because the Syncthing daemon is networked and probably polls some established connections or network announcements now and then. For the Syncthing macOS tray application it polls the daemon once in a while for status. So yes it can use some CPU when idle. For me this is not enough to do some deep profiling the macOS application or daemon. Syncthing is very CPU hungry when syncing/indexing because of all the crypto going on. Yes the constant CPU usage will drain your battery when on a macbook.