Created
June 12, 2026 11:31
-
-
Save sorentwo/91c898cd5635dc00de48d97bb464caa0 to your computer and use it in GitHub Desktop.
Autovacuum tuning for Oban Jobs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ALTER TABLE oban_jobs SET ( | |
| -- Vacuum earlier on large tables | |
| autovacuum_vacuum_scale_factor = 0.02, | |
| autovacuum_vacuum_threshold = 50, | |
| -- Keep stats fresh for the planner | |
| autovacuum_analyze_scale_factor = 0.02, | |
| autovacuum_analyze_threshold = 100, | |
| -- Make autovacuum push harder with little/no sleeping | |
| autovacuum_vacuum_cost_limit = 2000, | |
| autovacuum_vacuum_cost_delay = 1, | |
| -- Handle insert-heavy spikes (PG13+) | |
| autovacuum_vacuum_insert_scale_factor = 0.02, | |
| autovacuum_vacuum_insert_threshold = 1000, | |
| -- Leave headroom on pages for locality and fewer page splits | |
| fillfactor = 85 | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment