High cpu usage with no activity


i have 2 machines running syncthing:

  • one macbook pro, acting as the master (all folders are in folder master)
  • one Synology NAS, receiving all the files

I noticed some high cpu activity on the NAS, which has a not very powerful ARM cpu.

I got surprised with the following use case:

  • all folders are 100% synced
  • i restart Syncthing on the macbook pro
  • cpu of the NAS goes up to 70% usage. It takes a lot of time to reach a full “Up to date” status on the NAS. Strangely enough, the MBP’s GUI shows “up to date” for both devices while the NAS’ GUI shows “syncing”.
  • the devices also sent lots of data on the network, the restarted MBP shows 133MB download and 34MB upload. That seems a lot for not exchanging any files, since both were synced before.

I don’t understand why a reconnection from one node, when they were previously in sync, should trigger high cpu usage and lots of network exchange. Surely the devices need to ensure they still are in sync, but isn’t there an index or something to avoid this much cpu usage/data exchange ?

Yes there is an index and this index needs to be exchange completely after a reconnect. That’s why they need to send and receive data when connecting.

The high CPU usage is probably, because syncthing needs to read it’s index and store the index send by the MBP in a temp table (or something like that). Database access has a significant CPU impact, especially on low power devices.

The out of sync is probably also related to the fact, that it takes some time to process the index data on low power devices, and only after that, it can know if it is really in sync. As the MBP can process the data much faster than the NAS, it can tell nearly instantly, that both devices are in sync.

The work for a delta index has already begun but is currently on hold, which will decrease the amount of data exchange on reconnect significantly and probably the needed processing as well.

Thanks @wweich, i disabled syncthing on my NAS as the overhead on the local wifi and the NAS cpu is too high, since it happens everytime i bring my MBP back from sleep. I’ll wait for the milestone 1.0 to see how it goes for the NAS then.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.