You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FS notification watch aggregator stuck spinning on timers ("CPU Usage High with no mission") #9927
bugA problem with current functionality, as opposed to missing functionality (enhancement)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
I encountered this issue on both v1.20 and v1.27.7. Currently, the situation is that I don't have any tasks (there might have been some in the past, but at least right now there are no tasks), and CPU usage randomly spikes to very high levels. At this point, restarting syncthing resolves the issue, but whether it will reoccur or how long it will take to appear is uncertain.
This is the pprof I captured: cpu pprof heap pprof
It's actually somewhat fascinating, the CPU time is not doing GC but just setting up the bloom filters for the GC, something I'd expect to be pretty much instantaneous. Have you manually tweaked the interval for running GC? (--debug-db-indirect-gc-interval or $STGCINDIRECTEVERY)
It's actually somewhat fascinating, the CPU time is not doing GC but just setting up the bloom filters for the GC, something I'd expect to be pretty much instantaneous. Have you manually tweaked the interval for running GC? (--debug-db-indirect-gc-interval or $STGCINDIRECTEVERY)
Having the same or a similar issue on Linux with syncthing v1.29.6, where it would use a lot of CPU for long times, and a restart of syncthing immediately fixes it. I recently upgraded from v1.29.3 and don't remember having this issue before, I could be wrong though. I don't know if it cures itself after sometime, because I just restart it, because my fan becomes so loud (Ivy Bridge laptop)... Edit: Like OP, I have this issue while syncthing is not actively syncing anything, the Web GUI shows everything "Up to date".
Here are four CPU profiles from today (not from the Ivy Bridge laptop mentioned above, a slightly newer laptop). The CPU profiles were taken at a time where the CPU usage was high due to syncthing, everything was showing "Up to date" i.e. no active syncing, and nothing else noteworthy was running on the laptop.
In case it's useful, here is some basic data about the two synced folders that I use on this device. There is one folder with 290 small files that never change. Apart from this one, no folder contains more than 150 files.
I think it's a bug in the watch aggregator where it thinks there are events to handle, but there aren't and it's just spinning. Combined with a very low FSWatcherDelayS set on the folder?
I'm a bit lost, time.Duration is an int64, yet watcher delay is float, anything sub 1s gets rounded down to 0, so you just end up going into an infinite loop.
bugA problem with current functionality, as opposed to missing functionality (enhancement)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
Activity
calmh commentedon Jan 17, 2025
Looks like it's running database garbage collection. Some CPU usage is expected for that.
zhengran14 commentedon Jan 17, 2025
But what's strange is that once it reaches this state, the CPU usage remains high and doesn't decrease, even after days.
calmh commentedon Jan 17, 2025
It's actually somewhat fascinating, the CPU time is not doing GC but just setting up the bloom filters for the GC, something I'd expect to be pretty much instantaneous. Have you manually tweaked the interval for running GC? (
--debug-db-indirect-gc-intervalor$STGCINDIRECTEVERY)zhengran14 commentedon Jan 17, 2025
Did not use these.
camoz commentedon May 8, 2025
Having the same or a similar issue on Linux with syncthing v1.29.6, where it would use a lot of CPU for long times, and a restart of syncthing immediately fixes it. I recently upgraded from v1.29.3 and don't remember having this issue before, I could be wrong though. I don't know if it cures itself after sometime, because I just restart it, because my fan becomes so loud (Ivy Bridge laptop)... Edit: Like OP, I have this issue while syncthing is not actively syncing anything, the Web GUI shows everything "Up to date".
calmh commentedon May 9, 2025
Take a CPU profile please, or there is nothing to debug.
camoz commentedon May 14, 2025
Here are four CPU profiles from today (not from the Ivy Bridge laptop mentioned above, a slightly newer laptop). The CPU profiles were taken at a time where the CPU usage was high due to syncthing, everything was showing "Up to date" i.e. no active syncing, and nothing else noteworthy was running on the laptop.
In case it matters, here is how I have syncthing configured:
Sync Protocol Listen Addressestotcp4://:22000, quic4://:22000Enable NAT traversal,Global DiscoveryandEnable RelayingLocal DiscoveryfsWatcherDelaySto0.5or1calmh commentedon May 23, 2025
Those URLs are all errors for me
camoz commentedon May 23, 2025
@calmh Please try again, I reuploaded. Maybe they got deleted in the meantime. (For some reason I cannot upload them directly here.)
calmh commentedon May 23, 2025
Looks like it's reacting to lots and lots of filesystem notifications...
camoz commentedon May 23, 2025
In case it's useful, here is some basic data about the two synced folders that I use on this device. There is one folder with 290 small files that never change. Apart from this one, no folder contains more than 150 files.
calmh commentedon May 24, 2025
I think it's a bug in the watch aggregator where it thinks there are events to handle, but there aren't and it's just spinning. Combined with a very low FSWatcherDelayS set on the folder?
Adding the above profiles for stable storage:
profiles.zip
7 remaining items
AudriusButkevicius commentedon Jun 12, 2025
I'm a bit lost, time.Duration is an int64, yet watcher delay is float, anything sub 1s gets rounded down to 0, so you just end up going into an infinite loop.
https://go.dev/play/p/X3lB6DW8OKj
imsodin commentedon Jun 12, 2025
🤦
Not much more to say here. The person who suggested the config change clearly did think this through:
With "mostly" doing some very heavy lifting here xD
fix(watchaggregator): Properly handle sub-second watch durations (fixes
fix(watchaggregator): properly handle sub-second watch durations (fixes
fix(watchaggregator): properly handle sub-second watch durations (fixes
fix(watchaggregator): properly handle sub-second watch durations (fixes
fix(watchaggregator): properly handle sub-second watch durations (fixes
Merge branch 'main' into jb/slog
zhengran14 commentedon Jun 30, 2025
@calmh @imsodin In my case, I don't have any sync tasks also cpu high, is it possible that this bug could cause my situation as well?
this is my
(pprof) top:and
(pprof) list github.com/greatroar/blobloom.fpRate:Feature/merge upstream (#21)
chore(deps): update syncthing/syncthing docker tag to v2 (#2048)