Observation
On a small, low-traffic deployment (one user, mostly idle overnight), the write-ahead log grows much faster than the live data it holds.
Measured on disk, about 10 hours after the last compaction:
| File | Size |
|---|---|
| snapshot (live data after the last compaction) | ~3 MB |
| current log | ~51 MB |
- The log received ~48 MB in ~10 h, about 5 MB per hour, for ~3 MB of live data.
- With the default
CompactAfter(64 MB), this means a compaction about every 12 to 13 hours. - Each commit is appended and synced to disk, so the write volume translates into I/O and disk wear, not only space.
What is bounded
Disk usage stays bounded by snapshot + CompactAfter: the log is compacted back to the live data, so this is not a space leak.
Open questions
- Which keys or prefixes produce most of the appended bytes? (Count of records and bytes per key prefix over one log.)
- Are some writers rewriting values that did not change, or updating frequently (periodic status, timestamps, heartbeats)?
- Would a read-only tool that summarizes a log file (records, bytes and overwrites per prefix) help diagnose this in general?