Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 597f7e3

Browse filesBrowse files
committed
Correct the formulas for System V IPC parameters SEMMNI and SEMMNS in docs.
In runtime.sgml, the old formulas for calculating the reasonable values of SEMMNI and SEMMNS were incorrect. They have forgotten to count the number of semaphores which both the checkpointer process (introduced in 9.2) and the background worker processes (introduced in 9.3) need. This commit fixes those formulas so that they count the number of semaphores which the checkpointer process and the background worker processes need. Report and patch by Kyotaro Horiguchi. Only the patch for 9.3 was modified by me. Back-patch to 9.2 where the checkpointer process was added and the number of needed semaphores was increased. Author: Kyotaro Horiguchi Reviewed-by: Fujii Masao Backpatch: 9.2 Discussion: http://www.postgresql.org/message-id/20160203.125119.66820697.horiguchi.kyotaro@lab.ntt.co.jp
1 parent 851636b commit 597f7e3
Copy full SHA for 597f7e3

File tree

Expand file treeCollapse file tree

1 file changed

+8
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-6
lines changed

‎doc/src/sgml/runtime.sgml

Copy file name to clipboardExpand all lines: doc/src/sgml/runtime.sgml
+8-6Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -680,13 +680,13 @@ psql: could not connect to server: No such file or directory
680680
<row>
681681
<entry><varname>SEMMNI</></>
682682
<entry>Maximum number of semaphore identifiers (i.e., sets)</>
683-
<entry>at least <literal>ceil((max_connections + autovacuum_max_workers + 4) / 16)</literal></>
683+
<entry>at least <literal>ceil((max_connections + autovacuum_max_workers + max_worker_processes + 5) / 16)</literal></>
684684
</row>
685685

686686
<row>
687687
<entry><varname>SEMMNS</></>
688688
<entry>Maximum number of semaphores system-wide</>
689-
<entry><literal>ceil((max_connections + autovacuum_max_workers + 4) / 16) * 17</literal> plus room for other applications</>
689+
<entry><literal>ceil((max_connections + autovacuum_max_workers + max_worker_processes + 5) / 16) * 17</literal> plus room for other applications</>
690690
</row>
691691

692692
<row>
@@ -734,20 +734,22 @@ psql: could not connect to server: No such file or directory
734734

735735
<para>
736736
<productname>PostgreSQL</> uses one semaphore per allowed connection
737-
(<xref linkend="guc-max-connections">) and allowed autovacuum worker
738-
process (<xref linkend="guc-autovacuum-max-workers">), in sets of 16.
737+
(<xref linkend="guc-max-connections">), allowed autovacuum worker process
738+
(<xref linkend="guc-autovacuum-max-workers">) and allowed background
739+
process (<xref linkend="guc-max-worker-processes">), in sets of 16.
739740
Each such set will
740741
also contain a 17th semaphore which contains a <quote>magic
741742
number</quote>, to detect collision with semaphore sets used by
742743
other applications. The maximum number of semaphores in the system
743744
is set by <varname>SEMMNS</>, which consequently must be at least
744745
as high as <varname>max_connections</> plus
745-
<varname>autovacuum_max_workers</>, plus one extra for each 16
746+
<varname>autovacuum_max_workers</> plus <varname>max_worker_processes</>,
747+
plus one extra for each 16
746748
allowed connections plus workers (see the formula in <xref
747749
linkend="sysvipc-parameters">). The parameter <varname>SEMMNI</>
748750
determines the limit on the number of semaphore sets that can
749751
exist on the system at one time. Hence this parameter must be at
750-
least <literal>ceil((max_connections + autovacuum_max_workers + 4) / 16)</>.
752+
least <literal>ceil((max_connections + autovacuum_max_workers + max_worker_processes + 5) / 16)</>.
751753
Lowering the number
752754
of allowed connections is a temporary workaround for failures,
753755
which are usually confusingly worded <quote>No space

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.