diff options
| author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2007-04-16 18:30:04 +0000 |
|---|---|---|
| committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2007-04-16 18:30:04 +0000 |
| commit | e2a186b03cc1a87cf26644db18f28a20f10bd739 (patch) | |
| tree | a11e944e89e9757808f6d86dc9aa79ea6a94948a /src/include/storage | |
| parent | 42dc4b66e61cde4beb466561f12fd490b6621ee3 (diff) | |
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.
Diffstat (limited to 'src/include/storage')
| -rw-r--r-- | src/include/storage/lwlock.h | 3 | ||||
| -rw-r--r-- | src/include/storage/proc.h | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h index c47256a1599..477284b7d1d 100644 --- a/src/include/storage/lwlock.h +++ b/src/include/storage/lwlock.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/lwlock.h,v 1.35 2007/04/03 16:34:36 tgl Exp $ + * $PostgreSQL: pgsql/src/include/storage/lwlock.h,v 1.36 2007/04/16 18:30:04 alvherre Exp $ * *------------------------------------------------------------------------- */ @@ -61,6 +61,7 @@ typedef enum LWLockId BtreeVacuumLock, AddinShmemInitLock, AutovacuumLock, + AutovacuumScheduleLock, /* Individual lock IDs end here */ FirstBufMappingLock, FirstLockMgrLock = FirstBufMappingLock + NUM_BUFFER_PARTITIONS, diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index 772cf52cdf9..1fd4e264f09 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.97 2007/04/03 16:34:36 tgl Exp $ + * $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.98 2007/04/16 18:30:04 alvherre Exp $ * *------------------------------------------------------------------------- */ @@ -115,6 +115,8 @@ typedef struct PROC_HDR { /* Head of list of free PGPROC structures */ SHMEM_OFFSET freeProcs; + /* Head of list of autovacuum's free PGPROC structures */ + SHMEM_OFFSET autovacFreeProcs; /* Current shared estimate of appropriate spins_per_delay value */ int spins_per_delay; } PROC_HDR; |
