public inbox for [email protected]  
help / color / mirror / Atom feed
number of semaphores and semaphore sets
3+ messages / 3 participants
[nested] [flat]

* number of semaphores and semaphore sets
@ 2011-03-21 16:05 Anton Yuzhaninov <[email protected]>
  2011-04-05 16:57 ` Re: number of semaphores and semaphore sets Robert Haas <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Anton Yuzhaninov @ 2011-03-21 16:05 UTC (permalink / raw)
  To: pgsql-docs

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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: number of semaphores and semaphore sets
  2011-03-21 16:05 number of semaphores and semaphore sets Anton Yuzhaninov <[email protected]>
@ 2011-04-05 16:57 ` Robert Haas <[email protected]>
  2011-09-06 15:08   ` Re: number of semaphores and semaphore sets Bruce Momjian <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Robert Haas @ 2011-04-05 16:57 UTC (permalink / raw)
  To: Anton Yuzhaninov <[email protected]>; +Cc: pgsql-docs

On Mon, Mar 21, 2011 at 12:05 PM, Anton Yuzhaninov <[email protected]> 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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: number of semaphores and semaphore sets
  2011-03-21 16:05 number of semaphores and semaphore sets Anton Yuzhaninov <[email protected]>
  2011-04-05 16:57 ` Re: number of semaphores and semaphore sets Robert Haas <[email protected]>
@ 2011-09-06 15:08   ` Bruce Momjian <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Bruce Momjian @ 2011-09-06 15:08 UTC (permalink / raw)
  To: Robert Haas <[email protected]>; +Cc: Anton Yuzhaninov <[email protected]>; pgsql-docs

Robert Haas wrote:
> On Mon, Mar 21, 2011 at 12:05 PM, Anton Yuzhaninov <[email protected]> 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  <[email protected]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +


Attachments:

  [text/x-diff] /rtmp/semaphore (2.3K, 2-%2Frtmp%2Fsemaphore)
  download | inline diff:
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 ****
         <row>
          <entry><varname>SEMMNI</></>
          <entry>Maximum number of semaphore identifiers (i.e., sets)</>
!         <entry>at least <literal>ceil((max_connections + autovacuum_max_workers) / 16)</literal></>
         </row>
  
         <row>
          <entry><varname>SEMMNS</></>
          <entry>Maximum number of semaphores system-wide</>
!         <entry><literal>ceil((max_connections + autovacuum_max_workers) / 16) * 17</literal> plus room for other applications</>
         </row>
  
         <row>
--- 604,616 ----
         <row>
          <entry><varname>SEMMNI</></>
          <entry>Maximum number of semaphore identifiers (i.e., sets)</>
!         <entry>at least <literal>ceil((max_connections + autovacuum_max_workers + 4) / 16)</literal></>
         </row>
  
         <row>
          <entry><varname>SEMMNS</></>
          <entry>Maximum number of semaphores system-wide</>
!         <entry><literal>ceil((max_connections + autovacuum_max_workers + 4) / 16) * 17</literal> plus room for other applications</>
         </row>
  
         <row>
*************** psql: could not connect to server: No su
*** 685,691 ****
      linkend="sysvipc-parameters">).  The parameter <varname>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 <literal>ceil((max_connections + autovacuum_max_workers) / 16)</>.
      Lowering the number
      of allowed connections is a temporary workaround for failures,
      which are usually confusingly worded <quote>No space
--- 685,691 ----
      linkend="sysvipc-parameters">).  The parameter <varname>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 <literal>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 <quote>No space


^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2011-09-06 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-03-21 16:05 number of semaphores and semaphore sets Anton Yuzhaninov <[email protected]>
2011-04-05 16:57 ` Robert Haas <[email protected]>
2011-09-06 15:08   ` Bruce Momjian <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox