Tame autovacuum on a high-churn table
The default autovacuum threshold (20% of the table) is far too lax for a hot table. Per-table settings lower it, here from 100,050 dead rows down to 11,000, so cleanup keeps pace with churn.
Problem
What you're actually looking at
The symptom as it shows up on a real server.
Autovacuum triggers when dead tuples exceed autovacuum_vacuum_threshold + scale_factor * rows. At the default scale factor of 0.2, a large hot table has to accumulate a huge amount of bloat before cleanup starts. Per-table storage parameters fix that.
Meridian's session_tokens is updated constantly, 166,666 dead tuples already. At the default 0.2 scale factor autovacuum will not fire until ~100,050 dead rows, so bloat runs ahead of cleanup.
Simple terms
Autovacuum is the background job that clears out dead rows, and by default it waits until roughly a fifth of the table is dead before it kicks in. On a small table that is fine; on a big, constantly-updated one it means a mountain of bloat builds up before cleanup even starts. You can set a tighter threshold on just that one hot table so autovacuum keeps pace with the churn instead of falling behind it.
Full runbook for this incident
- The full identify checklist, the exact signals that tell you it's this incident
- Every diagnostic query; lab output is attached only to the steps we actually captured
- The resolution path and the pitfalls that make it worse
- Mitigation steps to stop it recurring, plus a verify-you're-done query
Card required. Cancel before day 7 and you are not charged.
More in this category
Other Vacuum & bloat runbooks
Neighbouring incidents that share the same diagnostic surface.
Connected
How this connects to the rest of the library
A live view of this page's real cross-references, what explains it, what fixes it, what to tune, and where to go next. Every link is an authored relationship, not a guess.
Fixes these errors
Need the full procedure?
Pro runbooks finish the incident path
Free runbooks teach the shape. Pro opens the full step transcript, edge cases, and prevention depth.