Hi, how to keep NETDATA data on UNRAID for last 2-3 months? to remove automatically older data? Currently I have over 3 GB of data and it keep growing.
Netdata stores metrics in the dbengine database, which uses a tiered retention system. By default:
Tier Resolution Time Limit Disk Space
0 per-second 14d 1GiB
1 per-minute 3mo 1GiB
2 per-hour 2y 1GiB
To keep 2–3 months of history, you may need to increase both retention time and disk space, especially for tier 0 or tier 1, because high-resolution metrics can reach the size limit before the time limit. Netdata deletes the oldest data first once the size limit is exceeded.
Configuring retention (time-based only option):
- Open your Netdata configuration file. On standard Linux installs it’s usually:
/etc/netdata/netdata.conf
If you’re running Netdata in a container, the file may be mounted elsewhere depending on your setup.
- Add or modify the
[db]section:
[db]
mode = dbengine
storage tiers = 3
# Tier 0 (per-second data)
dbengine tier 0 retention time = 90d
dbengine tier 0 retention size = xGiB # large enough to avoid triggering size deletion
# Tier 1 (per-minute data)
dbengine tier 1 retention time = 90d
dbengine tier 1 retention size = xGiB # large enough to avoid triggering size deletion
# Tier 2 (per-hour data)
dbengine tier 2 retention time = 2y
dbengine tier 2 retention size = 1GiB
- Restart Netdata to apply changes:
- If running as a Docker container:
docker restart <container_name>
- If running as a system service:
sudo systemctl restart netdata
You can monitor retention on the dashboard under dbengine retention to ensure limits are sufficient. Adjust sizes if the database grows faster than expected.
Thank you for reply, so after I add that in netdata.conf and restart docker it should instantly delete old data?
After you restart Netdata, it reloads the new retention limits and flags data older than those limits for removal. Netdata then gradually deletes the expired chunks in the background during its normal compaction process (this is how it frees disk space while still serving metrics without downtime). You can watch the effect in the dbengine retention chart, which will shrink to match your new limits once cleanup is complete.