Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 5227DB5DDD2 for ; Tue, 6 Sep 2011 12:09:10 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 29970-10 for ; Tue, 6 Sep 2011 15:09:03 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id C53C8B5DBD6 for ; Tue, 6 Sep 2011 12:09:02 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id p86F8pE07237; Tue, 6 Sep 2011 11:08:51 -0400 (EDT) From: Bruce Momjian Message-Id: <201109061508.p86F8pE07237@momjian.us> Subject: Re: number of semaphores and semaphore sets In-Reply-To: To: Robert Haas Date: Tue, 6 Sep 2011 11:08:51 -0400 (EDT) CC: Anton Yuzhaninov , pgsql-docs@postgresql.org X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ELM1315321731-20820-4_" Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201109/18 X-Sequence-Number: 6939 --ELM1315321731-20820-4_ Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" 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. + --ELM1315321731-20820-4_ Content-Transfer-Encoding: 7bit Content-Type: text/x-diff Content-Disposition: inline; filename="/rtmp/semaphore" 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 --ELM1315321731-20820-4_--