summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane2024-12-28 16:48:13 +0000
committerTom Lane2024-12-28 16:48:13 +0000
commita46311ed7214741ad0d38893da4285b2c2b468ad (patch)
tree4dd8bbdddc3c9da2bf597560c92b8ae4068b9fe0 /doc/src
parentfa6131377054d04f7c938b196b39eeb22784951b (diff)
Try to avoid semaphore-related test failures on NetBSD/OpenBSD.
These two platforms have a remarkably tight default limit on the number of SysV semaphores in the system: SEMMNS is only 60 out-of-the-box. Unless manual action is taken to raise that, we'll only be able to allocate 3 sets of 16 usable semaphores each, leading to initdb setting max_connections to just 20. That's problematic because the core regression tests expect to be able to launch 20 concurrent sessions, leaving us with no headroom. This seems to be the cause of intermittent buildfarm failures on some machines. While there's no getting around the fact that you'd better raise SEMMNS for production use on these platforms, it does seem desirable for "make check" to pass reliably without that. We can make that happen, at least for awhile longer, with two small changes: * Change sysv_sema.c's SEMAS_PER_SET to 19, so that we can eat up all of the available semas not just most of them. * Change initdb to make the smallest max_connections value it will consider be 25 not 20. This is a back-patch of recent HEAD commit 38da05346 into v17. The motivation for doing this now is that an upcoming bug-fix patch will give the new-in-17 slotsync worker process its own reserved PGPROC and hence also semaphore. With that patch but without this change, v17 would fail to start at all under the default SEMMNS on these platforms. Discussion: https://postgr.es/m/[email protected] Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/runtime.sgml14
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml
index 305147246da..893b30eb31a 100644
--- a/doc/src/sgml/runtime.sgml
+++ b/doc/src/sgml/runtime.sgml
@@ -781,19 +781,19 @@ psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such
<row>
<entry><varname>SEMMNI</varname></entry>
<entry>Maximum number of semaphore identifiers (i.e., sets)</entry>
- <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>
+ <entry>at least <literal>ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 7) / 19)</literal> plus room for other applications</entry>
</row>
<row>
<entry><varname>SEMMNS</varname></entry>
<entry>Maximum number of semaphores system-wide</entry>
- <entry><literal>ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 7) / 16) * 17</literal> plus room for other applications</entry>
+ <entry><literal>ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 7) / 19) * 20</literal> plus room for other applications</entry>
</row>
<row>
<entry><varname>SEMMSL</varname></entry>
<entry>Maximum number of semaphores per set</entry>
- <entry>at least 17</entry>
+ <entry>at least 20</entry>
</row>
<row>
@@ -840,20 +840,20 @@ psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such
(<xref linkend="guc-max-connections"/>), allowed autovacuum worker process
(<xref linkend="guc-autovacuum-max-workers"/>), allowed WAL sender process
(<xref linkend="guc-max-wal-senders"/>), and allowed background
- process (<xref linkend="guc-max-worker-processes"/>), in sets of 16.
+ process (<xref linkend="guc-max-worker-processes"/>), in sets of 19.
Each such set will
- also contain a 17th semaphore which contains a <quote>magic
+ also contain a 20th 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</varname>, which consequently must be at least
as high as <varname>max_connections</varname> plus
<varname>autovacuum_max_workers</varname> plus <varname>max_wal_senders</varname>,
- plus <varname>max_worker_processes</varname>, plus one extra for each 16
+ plus <varname>max_worker_processes</varname>, plus one extra for each 19
allowed connections plus workers (see the formula in <xref
linkend="sysvipc-parameters"/>). The parameter <varname>SEMMNI</varname>
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 + max_wal_senders + max_worker_processes + 7) / 16)</literal>.
+ least <literal>ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 7) / 19)</literal>.
Lowering the number
of allowed connections is a temporary workaround for failures,
which are usually confusingly worded <quote>No space