Skip to main content

Autovacuum global tuning

Three autovacuum parameters are recommended together because they are interdependent. Changing one without the others can make vacuuming slower, not faster.

The core problem

autovacuum_vacuum_cost_limit is a total I/O budget that PostgreSQL divides across running workers:

Raising worker count without also considering the cost budget can make each worker slower. pocketPG therefore treats worker count, cost limit, and delay as a coordinated decision instead of three independent toggles.

Decision sequence

The lead recommendation carries the decision sequence in its reason text:

  1. Per-table first — check whether per-table autovacuum overrides (in the Vacuum & Bloat tab) address the hot spots before touching globals.
  2. Adjust cost budget — increase throughput only when the evidence suggests vacuum is falling behind.
  3. Adjust worker count — add workers only when the cost budget can support them.
  4. Adjust delay carefully — avoid aggressive delay changes without understanding hardware and storage characteristics.

Priority

  • Per-table-first when only a few hot tables are causing pressure.
  • Higher priority when vacuum appears to be falling behind globally.
  • No action when autovacuum is keeping up.

autovacuum_analyze_scale_factor

Separate from the throughput parameters, pocketPG checks whether table statistics are becoming stale and whether global or per-table analyze settings should be tightened. It does not loosen deliberately tightened settings automatically.

warning

autovacuum_vacuum_cost_limit = -1 in pg_settings means PostgreSQL inherits from vacuum_cost_limit. pocketPG resolves inherited values before making a recommendation.