autovacuum_vacuum_cost_limit
I/O budget autovacuum spends before sleeping for autovacuum_vacuum_cost_delay; -1 uses vacuum_cost_limit.
- Predeterminado
-1 (uses vacuum_cost_limit = 200)- Range
- -1, or 1 to 10000
- Restart needed
- No
- Default checked on
- PostgreSQL 18
Lo que hace
The budget is shared across all running workers. With the defaults (200 and a 2ms delay) autovacuum is throttled to a modest share of disk bandwidth.
Valor predeterminado
-1 (uses vacuum_cost_limit = 200). -1 (PostgreSQL 18). The delay default has been 2ms since PostgreSQL 12 (it was 20ms).
Check the current value
SHOW autovacuum_vacuum_cost_limit; SELECT setting, unit, boot_val, context, source, pending_restart FROM pg_settings WHERE name = 'autovacuum_vacuum_cost_limit';
Change it
ALTER SYSTEM SET autovacuum_vacuum_cost_limit = 2000; SELECT pg_reload_conf();
No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).
When to change it
When autovacuum cannot keep up on fast storage. Values of 1000-2000 are common on SSDs.
What can go wrong
Higher values let autovacuum compete harder with queries for I/O.
Questions about autovacuum_vacuum_cost_limit
What is the default value of autovacuum_vacuum_cost_limit in PostgreSQL?
-1 (uses vacuum_cost_limit = 200). -1 (PostgreSQL 18). The delay default has been 2ms since PostgreSQL 12 (it was 20ms).
Does changing autovacuum_vacuum_cost_limit require a restart?
No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).
When should I change autovacuum_vacuum_cost_limit?
When autovacuum cannot keep up on fast storage. Values of 1000-2000 are common on SSDs.
Back to all PostgreSQL settings, or check the PostgreSQL manual for every option.
Check autovacuum_vacuum_cost_limit on your own server
SQLly runs the query above against PostgreSQL and the other engines in this reference, from one desktop app on macOS, Windows and Linux.