High write access rate on SD Card
Moderators: leecollings, remb0
-
- Posts: 65
- Joined: Tuesday 12 May 2015 12:09
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Last
- Location: Belgium
- Contact:
High write access rate on SD Card
Hi everyone,
i wonder that Domoticz is the main process which writes on my filesystem (a SD card).
The results are found with iotop command
In half hour, it writes more than 50 000 Ko of data by several threads
- MainWorker
- MainWorkerRxMsg
- WebServer_8080
Is there a way to reduces this?
Currently, i use log2ram to store the log of domoticz.
Have you got any idea to reduce writing ?
Thank you.
i wonder that Domoticz is the main process which writes on my filesystem (a SD card).
The results are found with iotop command
In half hour, it writes more than 50 000 Ko of data by several threads
- MainWorker
- MainWorkerRxMsg
- WebServer_8080
Is there a way to reduces this?
Currently, i use log2ram to store the log of domoticz.
Have you got any idea to reduce writing ?
Thank you.
-
- Posts: 65
- Joined: Tuesday 12 May 2015 12:09
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Last
- Location: Belgium
- Contact:
Re: High write access rate on SD Card
It says "/home/pi/domoticz/domoticz.db-wal !! This will no longer work for domoticz version V4.11753 and newer" I use 2022 version.
Last edited by YellowSky on Thursday 02 March 2023 13:12, edited 1 time in total.
-
- Posts: 661
- Joined: Saturday 21 September 2019 17:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.1
- Location: The Netherlands
- Contact:
Re: High write access rate on SD Card
Yes. I know and am not sure about what that means. See my question here:
viewtopic.php?p=292569#p292569
Never answered .....
I should have mentioned, sorry.
I still did implement it and it still seams to works. The only problem I found is when domoticz is shut down it does not properly clean up those files like it does it the default setup and then a restore becomes tricky.
Alternatively, you might want to look at this post:
viewtopic.php?p=292439#p292439
viewtopic.php?p=292569#p292569
Never answered .....
I should have mentioned, sorry.
I still did implement it and it still seams to works. The only problem I found is when domoticz is shut down it does not properly clean up those files like it does it the default setup and then a restore becomes tricky.
Alternatively, you might want to look at this post:
viewtopic.php?p=292439#p292439
-
- Posts: 663
- Joined: Thursday 10 November 2016 9:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: High write access rate on SD Card
In /etc/sysctl.conf, you may add/tune:
Code: Select all
vm.dirty_ratio=60
vm.dirty_expire_centisecs=120000
Quick& easy, without even needing to put logs in a tmpfs...
-
- Posts: 65
- Joined: Tuesday 12 May 2015 12:09
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Last
- Location: Belgium
- Contact:
Re: High write access rate on SD Card
Thank you for your answers.
For the etc/sysctl.conf: if i use log2ram is it usefull? This command requires a reboot?
For the moving of file of domoticz database
what does mean
For the etc/sysctl.conf: if i use log2ram is it usefull? This command requires a reboot?
For the moving of file of domoticz database
what does mean
a restore becomes tricky.
-
- Posts: 661
- Joined: Saturday 21 September 2019 17:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.1
- Location: The Netherlands
- Contact:
Re: High write access rate on SD Card
I mean I have not fully figured out the logic then. If I restore an older database while the wal and shm files still exists, it seems to roll forward to the new state anyway (but is it complete?). If I remvoe the wal and shm files first it seems to do a proper restore of the old state. But I am not totally sure. That's why I used the word "tricky'.what does mean : a restore becomes tricky.
-
- Posts: 65
- Joined: Tuesday 12 May 2015 12:09
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Last
- Location: Belgium
- Contact:
Re: High write access rate on SD Card
Ok, thank you.
I put the db in log2ram directory (var/log) and it works since two days even with reboot.
It remains to check when there is a power outage.
I put the db in log2ram directory (var/log) and it works since two days even with reboot.
It remains to check when there is a power outage.
-
- Posts: 663
- Joined: Thursday 10 November 2016 9:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: High write access rate on SD Card
You'll loose all logs since last sync to storage, so up to 24h with default sync periodicity.
That's why I stick to virtual memory management tuning (using sysfs entries for tuning & sysctl.conf when a good compromise is found after some tests) that are base Linux feature, thus system wide + easier to setup. Being a kernel feature, "controlled crash" scenario can be handled better (immediate data sync) than using an external tool.
Lots of tuning "knobs are available:
https://docs.kernel.org/admin-guide/sysctl/vm.html
Remains the power-fail but in my settings I loose 2mn max + this is unlikely as my system is powered through a LiPo battery buffer.
That's light setup, being 5Vdc, and lasting longer compared to a 220V based UPS with much more conversion/storage losses: 220Vac->Usually 12Vdc copper based (!!) battery->220Vac->220Vac/5Vdc-USB->PI, opposed to 220Vac->DC LiPo 5V(+12/19V usually, so can also back the internet/fiber router power)->PI. As a bonus, that's also cheaper (purchase+usage)
-
- Posts: 65
- Joined: Tuesday 12 May 2015 12:09
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Last
- Location: Belgium
- Contact:
Re: High write access rate on SD Card
In my case, i've just bought an UPS with 5V output (10W) and everything works fine during the power outtage of my town this morning... 
To be honest the tuning of the virtual memoryis not clear for me...
Moreover, due to large database (50 Mo) and frequent writing, i think (but i'am maybe wrong) that the ram disk is required, no?

To be honest the tuning of the virtual memoryis not clear for me...
Moreover, due to large database (50 Mo) and frequent writing, i think (but i'am maybe wrong) that the ram disk is required, no?
Who is online
Users browsing this forum: No registered users and 1 guest