InfluxDB using loads of CPU and disk IO

Hi, I have a Pi4 with H, MariaDB and InfluxDB. All working well. However, I wanted to reduce the diskIO as it seemed to have a constant discIO, I assumed it was due to the Recorder and InfluxDB. So I have set an agressive reduction in the included items in the Recorder section and set it to commit every 30 seconds. However, InfluxDB still uses lots of CPU every few seconds and the disk writes dont weem to have reduced.

Do you have any suggestions on how to proceed? Any way to find out what is using the discIO and why InfluxDB is 20% CPU every few seconds?

Thank you

This is because you are using a pi instead of a database server, there is a reason those cost craploads of money, and that is because database software eats up lots of system resources, the kind that a pi does not have. Of course, the volume of data that HA will log is low, so this can be mitigated.

it is a timescale database and needs to consolidate all the information it receives into a format which can be written to disk. Its settings are completely separate from the recorder settings. What Influx is doing is writing a copy of the in-memory cache to disk saying there was no data during that period, in case of system failure, and recovers it when it restarts. Every 10 minutes whatever is in the cache is written to the database itself, then wiped from memory. If it did not write to disk, there could be up to a 10 minute gap in the data if the system goes down suddenly.

It also monitors itself and keeps statistics for debugging and management purposes, and keeps detailed access logs.

I believe the settings you want to change are wal-fsync-delay, which will control how often it will write to disk (set to match recorder, 5 or 10 seconds max), and store-enabled to false, which will turn off the internal database and statistics monitoring, and query-log-enabled to false, which does exactly what it sounds like it would.

1 Like

Hey Richie, thanks for the detailed reply. It makes sense about the Pi vs. DB server, I get that. Also, the points around what InfluxBD is doing in the background may explain why there is more activity there than just the Recorder commit.

I may look at the settings you mention or I may just have to accept that this activity comes with using such DB/data apps on the HA Pi.

Thanks again.