// postgresql · vacuum, statistics & maintenance

autovacuum_max_workers

How many autovacuum workers can run at the same time.

デフォルト
3
Range
1 to autovacuum_worker_slots (262143 maximum)
Restart needed
いいえ
Default checked on
PostgreSQL 18

何ができるか

Each worker vacuums one table at a time. From PostgreSQL 18 it can be raised with a reload up to autovacuum_worker_slots (default 16); before 18 it needed a restart.

デフォルト値

3. 3 (PostgreSQL 18). Context changed from postmaster to sighup in 18.

Check the current value

SHOW autovacuum_max_workers;

SELECT setting, unit, boot_val, context, source, pending_restart
FROM pg_settings
WHERE name = 'autovacuum_max_workers';

Change it

ALTER SYSTEM SET autovacuum_max_workers = 6;
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

Databases with many busy tables where pg_stat_user_tables shows n_dead_tup climbing and last_autovacuum lagging. More workers share the same cost limit, so raise autovacuum_vacuum_cost_limit too.

What can go wrong

Without a higher cost limit, more workers each run slower; with one, they add I/O.

Questions about autovacuum_max_workers

What is the default value of autovacuum_max_workers in PostgreSQL?

3. 3 (PostgreSQL 18). Context changed from postmaster to sighup in 18.

Does changing autovacuum_max_workers 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_max_workers?

Databases with many busy tables where pg_stat_user_tables shows n_dead_tup climbing and last_autovacuum lagging. More workers share the same cost limit, so raise autovacuum_vacuum_cost_limit too.

Back to all PostgreSQL settings, or check the PostgreSQL manual for every option.

// one client for every engine

Check autovacuum_max_workers 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.