11<!--
2- $PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.303 2005/01/23 00:30:18 momjian Exp $
2+ $PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.304 2005/02/10 05:14:58 neilc Exp $
33-->
44
55<chapter Id="runtime">
@@ -4351,9 +4351,55 @@ options "SEMMNS=240"
43514351
43524352 <varlistentry>
43534353 <term><systemitem class="osname">FreeBSD</></term>
4354+ <indexterm><primary>FreeBSD</><secondary>IPC configuration</></>
4355+ <listitem>
4356+ <para>
4357+ The default settings are only suitable for small installations
4358+ (for example, default <varname>SHMMAX</varname> is 32
4359+ MB). Changes can be made via the <command>sysctl</command> or
4360+ <command>loader</command> interfaces. The following
4361+ parameters can be set using <command>sysctl</command>:
4362+ <screen>
4363+ <prompt>$</prompt> <userinput>systcl -w kern.ipc.shmall=32768</userinput>
4364+ <prompt>$</prompt> <userinput>systcl -w kern.ipc.shmmax=134217728</userinput>
4365+ <prompt>$</prompt> <userinput>systcl -w kern.ipc.semmap=256</userinput>
4366+ </screen>
4367+ To have these settings persist over reboots, modify
4368+ <filename>/etc/sysctl.conf</filename>.
4369+ </para>
4370+
4371+ <para>
4372+ The remaining sempahore settings are read-only as far as
4373+ <command>sysctl</command> is concerned, but can be changed
4374+ before boot using the <command>loader</command> prompt:
4375+ <screen>
4376+ <prompt>(loader)</prompt> <userinput>set kern.ipc.semmni=256</userinput>
4377+ <prompt>(loader)</prompt> <userinput>set kern.ipc.semmns=512</userinput>
4378+ <prompt>(loader)</prompt> <userinput>set kern.ipc.semmnu=256</userinput>
4379+ </screen>
4380+ Similarly these can be saved between reboots in
4381+ <filename>/boot/loader.conf</filename>.
4382+ </para>
4383+
4384+ <para>
4385+ You might also want to configure your kernel to lock shared
4386+ memory into RAM and prevent it from being paged out to swap.
4387+ This can be accomplished using the <command>sysctl</command>
4388+ setting <literal>kern.ipc.shm_use_phys</literal>.
4389+ </para>
4390+
4391+ <para>
4392+ <systemitem class="osname">FreeBSD</> versions before 4.0 work like
4393+ <systemitem class="osname">NetBSD</> and <systemitem class="osname">
4394+ OpenBSD</> (see below), except that the configuration file uses the
4395+ keyword "options" instead of "option".
4396+ </para>
4397+ </listitem>
4398+ </varlistentry>
4399+
4400+ <varlistentry>
43544401 <term><systemitem class="osname">NetBSD</></term>
43554402 <term><systemitem class="osname">OpenBSD</></term>
4356- <indexterm><primary>FreeBSD</><secondary>IPC configuration</></>
43574403 <indexterm><primary>NetBSD</><secondary>IPC configuration</></>
43584404 <indexterm><primary>OpenBSD</><secondary>IPC configuration</></>
43594405 <listitem>
@@ -4364,25 +4410,23 @@ options "SEMMNS=240"
43644410 the option <varname>SHMMAXPGS</> (in pages). The following
43654411 shows an example of how to set the various parameters:
43664412<programlisting>
4367- options SYSVSHM
4368- options SHMMAXPGS=4096
4369- options SHMSEG=256
4370-
4371- options SYSVSEM
4372- options SEMMNI=256
4373- options SEMMNS=512
4374- options SEMMNU=256
4375- options SEMMAP=256
4413+ option SYSVSHM
4414+ option SHMMAXPGS=4096
4415+ option SHMSEG=256
4416+
4417+ option SYSVSEM
4418+ option SEMMNI=256
4419+ option SEMMNS=512
4420+ option SEMMNU=256
4421+ option SEMMAP=256
43764422</programlisting>
4377- (On <systemitem class="osname">NetBSD</> and <systemitem
4378- class="osname">OpenBSD</> the key word is actually
4379- <literal>option</literal> singular.)
43804423 </para>
4424+
43814425 <para>
43824426 You might also want to configure your kernel to lock shared
43834427 memory into RAM and prevent it from being paged out to swap.
4384- Use the <command>sysctl</> setting
4385- <literal>kern.ipc.shm_use_phys</>.
4428+ This can be accomplished using the <command>sysctl</command>
4429+ setting <literal>kern.ipc.shm_use_phys</literal >.
43864430 </para>
43874431 </listitem>
43884432 </varlistentry>
@@ -4589,7 +4633,6 @@ set semsys:seminfo_semmsl=32
45894633 </varlistentry>
45904634
45914635 </variablelist>
4592-
45934636 </sect2>
45944637
45954638