You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation for System V IPC parameters provides complicated
formulas to determine the appropriate values for SEMMNI and SEMMNS.
Furthermore, these formulas have often been wrong because folks
forget to update them (e.g., when adding a new auxiliary process).
This commit introduces a new runtime-computed GUC named
num_os_semaphores that reports the number of semaphores needed for
the configured number of allowed connections, worker processes,
etc. This new GUC allows us to simplify the formulas in the
documentation, and it should help prevent future inaccuracies.
Like the other runtime-computed GUCs, users can view it with
"postgres -C" before starting the server, which is useful for
preconfiguring the necessary operating system resources.
Reviewed-by: Tom Lane, Sami Imseih, Andres Freund, Robert Haas
Discussion: https://postgr.es/m/20240517164452.GA1914161%40nathanxps13
Copy file name to clipboardExpand all lines: doc/src/sgml/runtime.sgml
+19-12Lines changed: 19 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -781,13 +781,13 @@ psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such
781
781
<row>
782
782
<entry><varname>SEMMNI</varname></entry>
783
783
<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 + 7) / 16)</literal> plus room for other applications</entry>
784
+
<entry>at least <literal>ceil(num_os_semaphores / 16)</literal> plus room for other applications</entry>
785
785
</row>
786
786
787
787
<row>
788
788
<entry><varname>SEMMNS</varname></entry>
789
789
<entry>Maximum number of semaphores system-wide</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>
790
+
<entry><literal>ceil(num_os_semaphores / 16) * 17</literal> plus room for other applications</entry>
791
791
</row>
792
792
793
793
<row>
@@ -839,21 +839,28 @@ psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such
839
839
<productname>PostgreSQL</productname> uses one semaphore per allowed connection
840
840
(<xref linkend="guc-max-connections"/>), allowed autovacuum worker process
841
841
(<xref linkend="guc-autovacuum-max-workers"/>), allowed WAL sender process
842
-
(<xref linkend="guc-max-wal-senders"/>), and allowed background
843
-
process (<xref linkend="guc-max-worker-processes"/>), in sets of 16.
0 commit comments