Limit database writes

Hi guys,

Is there any way to limit writes to syncthing database (index-v0.14.0.db) if there is nothing happening? I am working on setup of linux for small embedded device where all OS resides on SD card. During my testing I noticed that there is constant activity on mentioned folder even if nothing changes - not a lot in terms of raw megabytes but given its nature and writes amplification of SD card it adds up quickly. My general objective is to limit SD card writes as much as possible to avoid its premature failure.

Any thoughts?

No, sadly there are periodic stats that are collected in the database which cannot be disabled.

Thx. At least I know now. Back to the drawing board:)

You can use the tricks from laptop-mode to ignore sync() calls and bunch writes together.

You may setup a tiny tmpfs to hold the log file in question.

The only drawback I see is that the logfile will be lost after a reboot or after a re-mount. Choose carfully what files you can accept to loose. Ephemeral data.

I do it a lot for different files which lack interest after having ‘aged’. Especially on a RPi, but also on other computers using SSD storage.

Thx! This is what I am doing for the last couple of days. Works like a charm. Fresh db rebuilt after every restart is not an issue in my case as I sync limited amount of data.

Here is my fstab entry if anybody is interested:

tmpfs /home/servo/.config/syncthing/index-v0.14.0.db tmpfs size=50M,uid=servo,gid=servo 0 0