InfluxDB 1.8.3 disk usage leak on Raspberry Pi (docker)

Hi all,

I’m extremely novice in linux/raspberry pi and I’ve set up an instance of InfluxDB 1.8.3 on a container with the IOTstack, and grafana and mosquitto running on separate containers, all activated with the same docker-compose.yml. I also have an instance of log2ram with 400MB allocated disk size.

DESCRIPTION: Everything is running fine, I’m currently feeding the DB with some ESP32 and sensors (around 20 total) with a 10 seconds frequency each. I use Grafana for data visualization. Couldn’t set up telegraf and Node-red was using 100% CPU to MQTT feed the influx instance, so I decided do send data directly from the 5 ESP32 chips I have.

I have 4 measurements (each room of my house), each with some fields such as temperature, humidity, CO2, sensor spec, unit, etc.

Cardinality is only as high as 31 among measurements, series, tags and fields.

THE PROBLEM: some kind of data leak is happening because it’s filling the SD card in a rate of around 0.5 MB/s, which in the course of a week or less fills the entire 16 GB.

TEMPORARY SOLUTION: after the disk is full (or close), checking through df -Bm, I run docker-compose down, which stops the three containers. Then I run docker-compose up -d --remove-orphans and it starts the stack of influxdb, mosquitto and grafana. After running df -Bm again, all the wasted disk usage is freed and NO DATA LOSS HAPPENS!

FURTHER DIAGNOSYS: I made sure to check it’s not the grafana container which is filling up the disk so between mosquitto and influxdb I’d bet the disk usage leak is happening on Influxdb.

THE ASK: Can anybody help me out how to fix this data leakage so I can improve my server uptime and (hopefully) my SD card life without this maintenance? THANKS SO MUCH, I’m trying for three months but can’t fix it no matter what.

there is a housekeeping process that cleans the wal and meta files. So every time you restart influxd, it tries to clean them up. Think that down-sampling (via a continuous query and retention policies) helps this, but there might be another solution. Be careful, since it can be very ram intensive and found my rpi running out of memory and thus unable to start.

Also, if you want to use this long term, an sd card won’t last. I found that using a ssd helps for long term stability when using a rpi.