← sources

Uptime Kuma SQLite DB keeps growing and won't shrink

source: reddit (reddit:selfhosted)published 2026-09-14 12:37ingested 2026-09-15 02:38

retained text

Self-hosted Uptime Kuma with the SQLite backend here, and the database file has grown to roughly 400 MB and keeps climbing even though keepDataPeriodDays is set to 30 and I prune old monitors regularly.

Things I've tried so far: a `PRAGMA integrity_check` comes back clean, a manual `VACUUM` runs without error but the file barely shrinks, and the history trim in the UI doesn't reclaim the space from the older heartbeats — a chunk of rows older than the retention window are still sitting in the table. The box's disk is at about 92% used, so this is starting to feel urgent.

The clue I found was the nightly maintenance cron job that is supposed to vacuum and compact the DB: it was a silent no-op, because it selects the Docker container by a name that stopped matching after the container was renamed, so the vacuum has effectively never been running. Even pointed at the right container now, a forced vacuum doesn't free up what I'd expect.

Has anyone seen a Kuma database that ignores retention and refuses to shrink? Am I right that all the data lives in one SQLite file (plus its WAL), or is there somewhere else the measurement history accumulates? I'd rather reclaim the space without dropping historical availability data, so any approach that compacts selectively would be welcome.

document fetched 2026-09-15 00:31 · canonical https://reddit.com/r/selfhosted/comments/1wg289i/uptime_kuma_sqlite_db_keeps_growing_and_wont