# Limit database writes

**URL:** https://forum.syncthing.net/t/limit-database-writes/13702
**Category:** General
**Created:** [August 30, 2019, 1:55pm UTC](https://forum.syncthing.net/t/limit-database-writes/13702 "2019-08-30T13:55:13Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![kapitainsky](https://forum.syncthing.net/user_avatar/forum.syncthing.net/kapitainsky/32/16488_2.png) [@kapitainsky](https://forum.syncthing.net/u/kapitainsky)
#### Post date: [August 30, 2019, 1:55pm UTC](https://forum.syncthing.net/t/limit-database-writes/13702/1 "2019-08-30T13:55:14Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [August 30, 2019, 2:30pm UTC](https://forum.syncthing.net/t/limit-database-writes/13702/2 "2019-08-30T14:30:51Z")

</div>

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

---

<div class="post-metadata">

### Author: ![kapitainsky](https://forum.syncthing.net/user_avatar/forum.syncthing.net/kapitainsky/32/16488_2.png) [@kapitainsky](https://forum.syncthing.net/u/kapitainsky)
#### Post date: [August 30, 2019, 2:33pm UTC](https://forum.syncthing.net/t/limit-database-writes/13702/3 "2019-08-30T14:33:08Z")

</div>

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

---

<div class="post-metadata">

### Author: ![wscott](https://forum.syncthing.net/user_avatar/forum.syncthing.net/wscott/32/2956_2.png) [@wscott](https://forum.syncthing.net/u/wscott)
#### Post date: [August 31, 2019, 10:59am UTC](https://forum.syncthing.net/t/limit-database-writes/13702/4 "2019-08-31T10:59:06Z")

</div>

You can use the tricks from [laptop-mode](https://github.com/rickysarraf/laptop-mode-tools) to ignore sync() calls and bunch writes together.

---

<div class="post-metadata">

### Author: ![Guz](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/g/41988e/32.png) [@Guz](https://forum.syncthing.net/u/Guz)
#### Post date: [September 3, 2019, 2:18pm UTC](https://forum.syncthing.net/t/limit-database-writes/13702/5 "2019-09-03T14:18:15Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![kapitainsky](https://forum.syncthing.net/user_avatar/forum.syncthing.net/kapitainsky/32/16488_2.png) [@kapitainsky](https://forum.syncthing.net/u/kapitainsky)
#### Post date: [September 3, 2019, 2:31pm UTC](https://forum.syncthing.net/t/limit-database-writes/13702/6 "2019-09-03T14:31:37Z")

</div>

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
