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

Commit 2763cc4

Browse files
committed
Doc: update our docs about kernel IPC parameters on *BSD.
runtime.sgml said that you couldn't change SysV IPC parameters on OpenBSD except by rebuilding the kernel. That's definitely wrong in OpenBSD 6.x, and excavation in their man pages says it changed in OpenBSD 3.3. Update NetBSD and OpenBSD sections to recommend adjustment of the SEMMNI and SEMMNS settings, which are painfully small by default on those platforms. (The discussion thread contemplated recommending that people select POSIX semaphores instead, but the performance consequences of that aren't really clear, so I'll refrain.) Remove pointless discussion of SEMMNU and SEMMAP from the FreeBSD section. Minor other wordsmithing. Discussion: https://postgr.es/m/27582.1546928073@sss.pgh.pa.us
1 parent bbce27c commit 2763cc4

File tree

1 file changed

+43
-19
lines changed

1 file changed

+43
-19
lines changed

doc/src/sgml/runtime.sgml

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,8 @@ psql: could not connect to server: No such file or directory
768768
<para>
769769
In some cases it might also be necessary to increase
770770
<varname>SEMMAP</> to be at least on the order of
771-
<varname>SEMMNS</>. This parameter defines the size of the semaphore
771+
<varname>SEMMNS</>. If the system has this parameter
772+
(many do not), it defines the size of the semaphore
772773
resource map, in which each contiguous block of available semaphores
773774
needs an entry. When a semaphore set is freed it is either added to
774775
an existing entry that is adjacent to the freed block or it is
@@ -821,7 +822,7 @@ psql: could not connect to server: No such file or directory
821822
</term>
822823
<listitem>
823824
<para>
824-
The default settings can be changed using
825+
The default IPC settings can be changed using
825826
the <command>sysctl</command> or
826827
<command>loader</command> interfaces. The following
827828
parameters can be set using <command>sysctl</command>:
@@ -840,13 +841,9 @@ psql: could not connect to server: No such file or directory
840841
<programlisting>
841842
kern.ipc.semmni=256
842843
kern.ipc.semmns=512
843-
kern.ipc.semmnu=256
844844
</programlisting>
845-
After modifying these values a reboot is required for the new
845+
After modifying that file, a reboot is required for the new
846846
settings to take effect.
847-
(Note: FreeBSD does not use <varname>SEMMAP</>. Older versions
848-
would accept but ignore a setting for <literal>kern.ipc.semmap</>;
849-
newer versions reject it altogether.)
850847
</para>
851848

852849
<para>
@@ -870,7 +867,7 @@ kern.ipc.semmnu=256
870867

871868
<para>
872869
<systemitem class="osname">FreeBSD</> versions before 4.0 work like
873-
<systemitem class="osname">OpenBSD</> (see below).
870+
old <systemitem class="osname">OpenBSD</> (see below).
874871
</para>
875872
</listitem>
876873
</varlistentry>
@@ -885,12 +882,19 @@ kern.ipc.semmnu=256
885882
IPC parameters can be adjusted using <command>sysctl</command>,
886883
for example:
887884
<screen>
888-
<prompt>$</prompt> <userinput>sysctl -w kern.ipc.shmmax=16777216</userinput>
885+
<prompt>#</prompt> <userinput>sysctl -w kern.ipc.semmni=100</userinput>
889886
</screen>
890-
To have these settings persist over reboots, modify
887+
To make these settings persist over reboots, modify
891888
<filename>/etc/sysctl.conf</filename>.
892889
</para>
893890

891+
<para>
892+
You will usually want to increase <literal>kern.ipc.semmni</literal>
893+
and <literal>kern.ipc.semmns</literal>,
894+
as <systemitem class="osname">NetBSD</systemitem>'s default settings
895+
for these are uncomfortably small.
896+
</para>
897+
894898
<para>
895899
You might also want to configure your kernel to lock shared
896900
memory into RAM and prevent it from being paged out to swap.
@@ -899,10 +903,10 @@ kern.ipc.semmnu=256
899903
</para>
900904

901905
<para>
902-
<systemitem class="osname">NetBSD</> versions before 5.0 work like
903-
<systemitem class="osname">OpenBSD</> (see below), except that
904-
parameters should be set with the keyword <literal>options</> not
905-
<literal>option</>.
906+
<systemitem class="osname">NetBSD</systemitem> versions before 5.0
907+
work like old <systemitem class="osname">OpenBSD</systemitem>
908+
(see below), except that kernel parameters should be set with the
909+
keyword <literal>options</literal> not <literal>option</literal>.
906910
</para>
907911
</listitem>
908912
</varlistentry>
@@ -913,11 +917,31 @@ kern.ipc.semmnu=256
913917
</term>
914918
<listitem>
915919
<para>
916-
The options <varname>SYSVSHM</> and <varname>SYSVSEM</> need
917-
to be enabled when the kernel is compiled. (They are by
918-
default.) The maximum size of shared memory is determined by
919-
the option <varname>SHMMAXPGS</> (in pages). The following
920-
shows an example of how to set the various parameters:
920+
In <systemitem class="osname">OpenBSD</systemitem> 3.3 and later,
921+
IPC parameters can be adjusted using <command>sysctl</command>,
922+
for example:
923+
<screen>
924+
<prompt>#</prompt> <userinput>sysctl kern.seminfo.semmni=100</userinput>
925+
</screen>
926+
To make these settings persist over reboots, modify
927+
<filename>/etc/sysctl.conf</filename>.
928+
</para>
929+
930+
<para>
931+
You will usually want to
932+
increase <literal>kern.seminfo.semmni</literal>
933+
and <literal>kern.seminfo.semmns</literal>,
934+
as <systemitem class="osname">OpenBSD</systemitem>'s default settings
935+
for these are uncomfortably small.
936+
</para>
937+
938+
<para>
939+
In older <systemitem class="osname">OpenBSD</systemitem> versions,
940+
you will need to build a custom kernel to change the IPC parameters.
941+
Make sure that the options <varname>SYSVSHM</varname>
942+
and <varname>SYSVSEM</varname> are enabled, too. (They are by
943+
default.) The following shows an example of how to set the various
944+
parameters in the kernel configuration file:
921945
<programlisting>
922946
option SYSVSHM
923947
option SHMMAXPGS=4096

0 commit comments

Comments
 (0)