Optimising Syncthing for low end hardware

Nowadays there are also buffer settings that may be relevant, especially if there are multiple devices and/or folders involved.

  • maxConcurrentIncomingRequestKiB (maybe reduce to 32 MiB or so from the default of 256 MiB, avoids being overwhelmed by many clients asking for data)
  • pullerMaxPendingKiB (maybe reduce to 16 MiB from the default (IIRC) of 32 MiB, avoids allocating too much when pulling data)

Also, keep in mind those buffer sizes are not the limit on what will be allocated; they are the limit on the amount of data being processed at any given time. That data will be copied, hashed, compressed, etc, before garbage collection so the real memory usage will be a multiple of the buffer size.

Additionally, there’s the GOMEMLIMIT env var nowadays which is probably more effective than GOGC. Set GOMEMLIMIT=256MiB for example if you want the runtime to try hard to not use more than 256 MiB of memory. This won’t do magic – if Syncthing needs more, it will use more, but it will make the garbage collector at least try to stay within that limit. There’s further reading for the diligent student.