Add a multi-worker capability to autovacuum. This allows multiple worker
Alvaro Herrera <alvherre@alvh.no-ip.org>
Add a multi-worker capability to autovacuum. This allows multiple worker processes to be running simultaneously. Also, now autovacuum processes do not count towards the max_connections limit; they are counted separately from regular processes, and are limited by the new GUC variable autovacuum_max_workers. The launcher now has intelligence to launch workers on each database every autovacuum_naptime seconds, limited only on the max amount of worker slots available. Also, the global worker I/O utilization is limited by the vacuum cost-based delay feature. Workers are "balanced" so that the total I/O consumption does not exceed the established limit. This part of the patch was contributed by ITAGAKI Takahiro. Per discussion.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/config.sgml | modified | +24 −6 |
| doc/src/sgml/maintenance.sgml | modified | +36 −13 |
| src/backend/commands/vacuum.c | modified | +4 −1 |
| src/backend/postmaster/autovacuum.c | modified | +987 −115 |
| src/backend/storage/lmgr/proc.c | modified | +49 −13 |
| src/backend/utils/init/globals.c | modified | +7 −2 |
| src/backend/utils/misc/guc.c | modified | +46 −5 |
| src/backend/utils/misc/postgresql.conf.sample | modified | +1 −0 |
| src/include/miscadmin.h | modified | +2 −1 |
| src/include/postmaster/autovacuum.h | modified | +10 −1 |
| src/include/storage/lwlock.h | modified | +2 −1 |
| src/include/storage/proc.h | modified | +3 −1 |