PostgreSQL

Autovacuum falls behind on high-write tables due to conservative defaults

warning
Resource ContentionUpdated Mar 4, 2026
Technologies:
How to detect:

On tables with 10,000+ inserts/min and 5,000+ updates/min, default autovacuum settings (scale_factor 0.2, max_workers 3, naptime 60s) cannot keep pace, accumulating 300,000 dead tuples per hour and causing continuous table growth

Recommended action:

Apply aggressive autovacuum settings on Cloud SQL: set autovacuum_max_workers to 6, autovacuum_vacuum_scale_factor to 0.02, autovacuum_vacuum_cost_limit to 2000, autovacuum_vacuum_cost_delay to 0, autovacuum_naptime to 15. Use gcloud sql instances patch with --database-flags. For hottest tables, set per-table parameters with ALTER TABLE to scale_factor 0.005.