Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4ebe51a

Browse files
Fix documentation for System V semaphores.
The formulas for SEMMNI and SEMMNS do not include the archiver process, which was converted to an auxiliary process in v14, and the WAL summarizer process, which was introduced in v17. This commit corrects these formulas and adds a missing reference to max_wal_senders nearby. Since this section of the documentation tends to be incorrect quite often, we should likely give up on documenting the exact formulas in favor of something less fragile, but that is left as a future exercise. Reported-by: Sami Imseih Reviewed-by: Sami Imseih Discussion: https://postgr.es/m/20240517164452.GA1914161%40nathanxps13 Backpatch-through: 12
1 parent 8fea1bd commit 4ebe51a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doc/src/sgml/runtime.sgml

+5-4
Original file line numberDiff line numberDiff line change
@@ -781,13 +781,13 @@ psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such
781781
<row>
782782
<entry><varname>SEMMNI</varname></entry>
783783
<entry>Maximum number of semaphore identifiers (i.e., sets)</entry>
784-
<entry>at least <literal>ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 5) / 16)</literal> plus room for other applications</entry>
784+
<entry>at least <literal>ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 7) / 16)</literal> plus room for other applications</entry>
785785
</row>
786786

787787
<row>
788788
<entry><varname>SEMMNS</varname></entry>
789789
<entry>Maximum number of semaphores system-wide</entry>
790-
<entry><literal>ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 5) / 16) * 17</literal> plus room for other applications</entry>
790+
<entry><literal>ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 7) / 16) * 17</literal> plus room for other applications</entry>
791791
</row>
792792

793793
<row>
@@ -838,7 +838,8 @@ psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such
838838
When using System V semaphores,
839839
<productname>PostgreSQL</productname> uses one semaphore per allowed connection
840840
(<xref linkend="guc-max-connections"/>), allowed autovacuum worker process
841-
(<xref linkend="guc-autovacuum-max-workers"/>) and allowed background
841+
(<xref linkend="guc-autovacuum-max-workers"/>), allowed WAL sender process
842+
(<xref linkend="guc-max-wal-senders"/>), and allowed background
842843
process (<xref linkend="guc-max-worker-processes"/>), in sets of 16.
843844
Each such set will
844845
also contain a 17th semaphore which contains a <quote>magic
@@ -852,7 +853,7 @@ psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such
852853
linkend="sysvipc-parameters"/>). The parameter <varname>SEMMNI</varname>
853854
determines the limit on the number of semaphore sets that can
854855
exist on the system at one time. Hence this parameter must be at
855-
least <literal>ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 5) / 16)</literal>.
856+
least <literal>ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 7) / 16)</literal>.
856857
Lowering the number
857858
of allowed connections is a temporary workaround for failures,
858859
which are usually confusingly worded <quote>No space

0 commit comments

Comments
 (0)