mirror of
https://github.com/postgres/postgres.git
synced 2025-05-05 09:19:17 +03:00
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
This commit is contained in:
parent
bbce27c6dd
commit
2763cc4a03
@ -768,7 +768,8 @@ psql: could not connect to server: No such file or directory
|
|||||||
<para>
|
<para>
|
||||||
In some cases it might also be necessary to increase
|
In some cases it might also be necessary to increase
|
||||||
<varname>SEMMAP</> to be at least on the order of
|
<varname>SEMMAP</> to be at least on the order of
|
||||||
<varname>SEMMNS</>. This parameter defines the size of the semaphore
|
<varname>SEMMNS</>. If the system has this parameter
|
||||||
|
(many do not), it defines the size of the semaphore
|
||||||
resource map, in which each contiguous block of available semaphores
|
resource map, in which each contiguous block of available semaphores
|
||||||
needs an entry. When a semaphore set is freed it is either added to
|
needs an entry. When a semaphore set is freed it is either added to
|
||||||
an existing entry that is adjacent to the freed block or it is
|
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
|
|||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The default settings can be changed using
|
The default IPC settings can be changed using
|
||||||
the <command>sysctl</command> or
|
the <command>sysctl</command> or
|
||||||
<command>loader</command> interfaces. The following
|
<command>loader</command> interfaces. The following
|
||||||
parameters can be set using <command>sysctl</command>:
|
parameters can be set using <command>sysctl</command>:
|
||||||
@ -840,13 +841,9 @@ psql: could not connect to server: No such file or directory
|
|||||||
<programlisting>
|
<programlisting>
|
||||||
kern.ipc.semmni=256
|
kern.ipc.semmni=256
|
||||||
kern.ipc.semmns=512
|
kern.ipc.semmns=512
|
||||||
kern.ipc.semmnu=256
|
|
||||||
</programlisting>
|
</programlisting>
|
||||||
After modifying these values a reboot is required for the new
|
After modifying that file, a reboot is required for the new
|
||||||
settings to take effect.
|
settings to take effect.
|
||||||
(Note: FreeBSD does not use <varname>SEMMAP</>. Older versions
|
|
||||||
would accept but ignore a setting for <literal>kern.ipc.semmap</>;
|
|
||||||
newer versions reject it altogether.)
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -870,7 +867,7 @@ kern.ipc.semmnu=256
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<systemitem class="osname">FreeBSD</> versions before 4.0 work like
|
<systemitem class="osname">FreeBSD</> versions before 4.0 work like
|
||||||
<systemitem class="osname">OpenBSD</> (see below).
|
old <systemitem class="osname">OpenBSD</> (see below).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -885,12 +882,19 @@ kern.ipc.semmnu=256
|
|||||||
IPC parameters can be adjusted using <command>sysctl</command>,
|
IPC parameters can be adjusted using <command>sysctl</command>,
|
||||||
for example:
|
for example:
|
||||||
<screen>
|
<screen>
|
||||||
<prompt>$</prompt> <userinput>sysctl -w kern.ipc.shmmax=16777216</userinput>
|
<prompt>#</prompt> <userinput>sysctl -w kern.ipc.semmni=100</userinput>
|
||||||
</screen>
|
</screen>
|
||||||
To have these settings persist over reboots, modify
|
To make these settings persist over reboots, modify
|
||||||
<filename>/etc/sysctl.conf</filename>.
|
<filename>/etc/sysctl.conf</filename>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
You will usually want to increase <literal>kern.ipc.semmni</literal>
|
||||||
|
and <literal>kern.ipc.semmns</literal>,
|
||||||
|
as <systemitem class="osname">NetBSD</systemitem>'s default settings
|
||||||
|
for these are uncomfortably small.
|
||||||
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
You might also want to configure your kernel to lock shared
|
You might also want to configure your kernel to lock shared
|
||||||
memory into RAM and prevent it from being paged out to swap.
|
memory into RAM and prevent it from being paged out to swap.
|
||||||
@ -899,10 +903,10 @@ kern.ipc.semmnu=256
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<systemitem class="osname">NetBSD</> versions before 5.0 work like
|
<systemitem class="osname">NetBSD</systemitem> versions before 5.0
|
||||||
<systemitem class="osname">OpenBSD</> (see below), except that
|
work like old <systemitem class="osname">OpenBSD</systemitem>
|
||||||
parameters should be set with the keyword <literal>options</> not
|
(see below), except that kernel parameters should be set with the
|
||||||
<literal>option</>.
|
keyword <literal>options</literal> not <literal>option</literal>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -913,11 +917,31 @@ kern.ipc.semmnu=256
|
|||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The options <varname>SYSVSHM</> and <varname>SYSVSEM</> need
|
In <systemitem class="osname">OpenBSD</systemitem> 3.3 and later,
|
||||||
to be enabled when the kernel is compiled. (They are by
|
IPC parameters can be adjusted using <command>sysctl</command>,
|
||||||
default.) The maximum size of shared memory is determined by
|
for example:
|
||||||
the option <varname>SHMMAXPGS</> (in pages). The following
|
<screen>
|
||||||
shows an example of how to set the various parameters:
|
<prompt>#</prompt> <userinput>sysctl kern.seminfo.semmni=100</userinput>
|
||||||
|
</screen>
|
||||||
|
To make these settings persist over reboots, modify
|
||||||
|
<filename>/etc/sysctl.conf</filename>.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
You will usually want to
|
||||||
|
increase <literal>kern.seminfo.semmni</literal>
|
||||||
|
and <literal>kern.seminfo.semmns</literal>,
|
||||||
|
as <systemitem class="osname">OpenBSD</systemitem>'s default settings
|
||||||
|
for these are uncomfortably small.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
In older <systemitem class="osname">OpenBSD</systemitem> versions,
|
||||||
|
you will need to build a custom kernel to change the IPC parameters.
|
||||||
|
Make sure that the options <varname>SYSVSHM</varname>
|
||||||
|
and <varname>SYSVSEM</varname> are enabled, too. (They are by
|
||||||
|
default.) The following shows an example of how to set the various
|
||||||
|
parameters in the kernel configuration file:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
option SYSVSHM
|
option SYSVSHM
|
||||||
option SHMMAXPGS=4096
|
option SHMMAXPGS=4096
|
||||||
|
Loading…
x
Reference in New Issue
Block a user