aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2016-02-16 14:49:47 +0900
committerFujii Masao <fujii@postgresql.org>2016-02-16 14:49:47 +0900
commit597f7e3a6ec393cf9ff3e11552faf69ff0ab652b (patch)
tree032b5f835767f6323f9b00d4e0c50ce184686e47
parent851636bfdaa9aa62d5adfaa0aa8c06b408e0d8a9 (diff)
downloadpostgresql-597f7e3a6ec393cf9ff3e11552faf69ff0ab652b.tar.gz
postgresql-597f7e3a6ec393cf9ff3e11552faf69ff0ab652b.zip
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
-rw-r--r--doc/src/sgml/runtime.sgml14
1 files changed, 8 insertions, 6 deletions
diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml
index 209eb9e5234..c699f2170b7 100644
--- a/doc/src/sgml/runtime.sgml
+++ b/doc/src/sgml/runtime.sgml
@@ -680,13 +680,13 @@ psql: could not connect to server: No such file or directory
<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></>
+ <entry>at least <literal>ceil((max_connections + autovacuum_max_workers + max_worker_processes + 5) / 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</>
+ <entry><literal>ceil((max_connections + autovacuum_max_workers + max_worker_processes + 5) / 16) * 17</literal> plus room for other applications</>
</row>
<row>
@@ -734,20 +734,22 @@ psql: could not connect to server: No such file or directory
<para>
<productname>PostgreSQL</> uses one semaphore per allowed connection
- (<xref linkend="guc-max-connections">) and allowed autovacuum worker
- process (<xref linkend="guc-autovacuum-max-workers">), in sets of 16.
+ (<xref linkend="guc-max-connections">), allowed autovacuum worker process
+ (<xref linkend="guc-autovacuum-max-workers">) and allowed background
+ process (<xref linkend="guc-max-worker-processes">), in sets of 16.
Each such set will
also contain a 17th semaphore which contains a <quote>magic
number</quote>, to detect collision with semaphore sets used by
other applications. The maximum number of semaphores in the system
is set by <varname>SEMMNS</>, which consequently must be at least
as high as <varname>max_connections</> plus
- <varname>autovacuum_max_workers</>, plus one extra for each 16
+ <varname>autovacuum_max_workers</> plus <varname>max_worker_processes</>,
+ plus one extra for each 16
allowed connections plus workers (see the formula in <xref
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)</>.
+ least <literal>ceil((max_connections + autovacuum_max_workers + max_worker_processes + 5) / 16)</>.
Lowering the number
of allowed connections is a temporary workaround for failures,
which are usually confusingly worded <quote>No space