TSDB & RAM Tuning
Loki 3.x Compactor Retention & Disk Space Reclamation
Enable retention_enabled: true in the compactor block so expired 30-365 day chunks and TSDB tables actually delete from disk.
compaction_interval: 10m · delete_request_store: filesystem
Loki 3.x Requires delete_request_store
A common misconfiguration sets retention_period inside limits_config without enabling retention_enabled: true and delete_request_store: filesystem inside compactor.
Scheduling Compaction Outside Query Peaks
Keeping compaction_interval at 10m processes small incremental merges smoothly instead of triggering multi-hour I/O storms.
Measured Thresholds & Loki TSDB Parameters
| Compactor Key | Required Value | What Happens If Omitted |
|---|---|---|
| retention_enabled | true | Logs grow infinitely until disk hits 100% |
| retention_delete_delay | 2h | Grace buffer before chunk unlink |
| delete_request_store | filesystem | Required in Loki 3.x for retention pruning |