Since Syncthing upgrade, both of my raspberry Pi3 keeps crashing due to Out of memory problems. (Dmesg dump: https://pastebin.com/gYUvxyK4). One of the RPI’s is dedicated to Syncthing only.
How can I restrict memory use of Syncthing?
I’m starting Syncthing from systemd (systemctl) with following parameters.
[Unit]
Description=Syncthing - Open Source Continuous File Synchronization for %I
Documentation=man:syncthing(1)
After=network.target
Syncthing logs before the crash might be more helpful. You can set progressUpdateIntervalS and scanProgressIntervalS to -1 to reduce the memory footprint. Which version are you on?
Thank you for quick answer!
To prefent this, I moved database to external drive. Also have same problem on another RPi3. Pulling my hair out over this. (if i had any…)
Waiting for 1.2.0 won’t help. If the OOM occurs during pulling, it might be a known problem (pull queue can get huge and there’s no mechanism preventing that).
To debug this a good option to prevent flooding your system logs is to run Syncthinglogging, not through systemd, and enable model debug logging (e.g. STTRACE=model syncthing -no-browser -no-restart 2>&1 | tee syncthing.log). Then if you get something with *folder label* (*folder id*) pulling, then a ton of lines about specific files, and finally kill by OOM - pulling is indeed the problem and it would be very nice if you could share the logs (privately if the filenames are sensitive). There’s an ongoing change proposal that addresses this issue (pull queue growing too large) and seeing which part of the queue is getting flooded might give some clues for that.
For now i’m bypassing the big pull queue problem by using the “ignoring patterns” and gracefully deleting a filetype in the list of patterns on the receiving side each sync. It’s slow but works for now.
(+3TB Send Only folder on NAS, 2 RPi3’s with external powered USB drives in Receive Only mode)
sorry I have no idea if it would or not but could you use a spare flash drive you might have floating around for the swap memory to reduce the chances of it being removed by a user? or is the concern that the drive might not be mounted in the correct order at boot time?