number of semaphores and semaphore sets
number of semaphores and semaphore sets
От:
Anton Yuzhaninov <citrin@citrin.ru>
Дата:
This page: http://www.postgresql.org/docs/9.0/interactive/kernel-resources.html has formula: ceil((max_connections + autovacuum_max_workers) / 16) for number of semaphore sets (identifiers). It seems to be wrong (outdated). Correct formula seems to be ceil((max_connections + autovacuum_max_workers + 4) / 16) Semaphore sets created in src/backend/storage/lmgr/proc.c: 1. MaxConnections 2. autovacuum_max_workers + 1 3. NUM_AUXILIARY_PROCS (currently 3) -- Anton Yuzhaninov
Re: number of semaphores and semaphore sets
От:
Robert Haas <robertmhaas@gmail.com>
Дата:
On Mon, Mar 21, 2011 at 12:05 PM, Anton Yuzhaninov wrote: > This page: > http://www.postgresql.org/docs/9.0/interactive/kernel-resources.html > > has formula: > ceil((max_connections + autovacuum_max_workers) / 16) > > for number of semaphore sets (identifiers). > > It seems to be wrong (outdated). > > Correct formula seems to be > > ceil((max_connections + autovacuum_max_workers + 4) / 16) > > Semaphore sets created in src/backend/storage/lmgr/proc.c: > 1. MaxConnections > 2. autovacuum_max_workers + 1 > 3. NUM_AUXILIARY_PROCS (currently 3) Yeah, I think you're right. It appears that nothing material has changed here since 8.3, so I'm inclined to back-patch this doc fix back that far. Barring objections, I'll go change this. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Re: number of semaphores and semaphore sets
От:
Bruce Momjian <bruce@momjian.us>
Дата:
Robert Haas wrote:
> On Mon, Mar 21, 2011 at 12:05 PM, Anton Yuzhaninov wrote:
> > This page:
> > http://www.postgresql.org/docs/9.0/interactive/kernel-resources.html
> >
> > has formula:
> > ceil((max_connections + autovacuum_max_workers) / 16)
> >
> > for number of semaphore sets (identifiers).
> >
> > It seems to be wrong (outdated).
> >
> > Correct formula seems to be
> >
> > ceil((max_connections + autovacuum_max_workers + 4) / 16)
> >
> > Semaphore sets created in src/backend/storage/lmgr/proc.c:
> > 1. MaxConnections
> > 2. autovacuum_max_workers + 1
> > 3. NUM_AUXILIARY_PROCS (currently 3)
>
> Yeah, I think you're right. It appears that nothing material has
> changed here since 8.3, so I'm inclined to back-patch this doc fix
> back that far.
>
> Barring objections, I'll go change this.
I have applied the attached patch and backpatched it to 9.0 and 9.1.
--
Bruce Momjian http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml
new file mode 100644
index 5098aad..68ceff1
*** a/doc/src/sgml/runtime.sgml
--- b/doc/src/sgml/runtime.sgml
*************** psql: could not connect to server: No su
*** 604,616 ****
SEMMNI</></>
Maximum number of semaphore identifiers (i.e., sets)</>
! at least ceil((max_connections + autovacuum_max_workers) / 16)</>
SEMMNS</></>
Maximum number of semaphores system-wide</>
! ceil((max_connections + autovacuum_max_workers) / 16) * 17 plus room for other applications</>
--- 604,616 ----
SEMMNI</></>
Maximum number of semaphore identifiers (i.e., sets)</>
! at least ceil((max_connections + autovacuum_max_workers + 4) / 16)</>
SEMMNS</></>
Maximum number of semaphores system-wide</>
! ceil((max_connections + autovacuum_max_workers + 4) / 16) * 17 plus room for other applications</>
*************** psql: could not connect to server: No su
*** 685,691 ****
linkend="sysvipc-parameters">). The parameter SEMMNI</>
determines the limit on the number of semaphore sets that can
exist on the system at one time. Hence this parameter must be at
! least ceil((max_connections + autovacuum_max_workers) / 16)</>.
Lowering the number
of allowed connections is a temporary workaround for failures,
which are usually confusingly worded No space
--- 685,691 ----
linkend="sysvipc-parameters">). The parameter SEMMNI</>
determines the limit on the number of semaphore sets that can
exist on the system at one time. Hence this parameter must be at
! least ceil((max_connections + autovacuum_max_workers + 4) / 16)</>.
Lowering the number
of allowed connections is a temporary workaround for failures,
which are usually confusingly worded No space