Move "maxusers n" from the kernel configuration chapter to the tuning

kernel limits chapter.

Suggested by:	blackend (some time ago)
Approved by:	brueffer (mentor)
This commit is contained in:
Joel Dahl 2005-08-25 09:01:08 +00:00
parent 150cec30e4
commit 0fe6859cda
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=25446
2 changed files with 44 additions and 59 deletions

View file

@ -2046,9 +2046,9 @@ device_probe_and_attach: cbb0 attach returned 12</screen>
kind and number of services running concurrently.</para>
<para><varname>kern.maxfile</varname>'s default value is
dictated by the <option>MAXUSERS</option> option in your
dictated by the <option>maxusers</option> option in your
kernel configuration file. <varname>kern.maxfiles</varname> grows
proportionally to the value of <option>MAXUSERS</option>. When
proportionally to the value of <option>maxusers</option>. When
compiling a custom kernel, it is a good idea to set this kernel
configuration option according to the uses of your system. From
this number, the kernel is given most of its pre-defined limits.
@ -2056,10 +2056,48 @@ device_probe_and_attach: cbb0 attach returned 12</screen>
connected at once, the resources needed may be similar to a
high-scale web server.</para>
<note><para>As of &os;&nbsp;4.5, setting <option>MAXUSERS</option> to
<literal>0</literal> in your kernel configuration file will choose
a reasonable default value based on the amount of RAM present in
your system.</para></note>
<para>Starting with &os;&nbsp;4.5, the system will auto-tune
<literal>maxusers</literal> for you if you explicitly set it to
<literal>0</literal><footnote>
<para>The auto-tuning algorithm sets
<literal>maxusers</literal> equal to the amount of memory in the
system, with a minimum of 32, and a maximum of 384.</para>
</footnote>. In &os;&nbsp;5.X and above, <literal>maxusers</literal>
will default to <literal>0</literal> if not specified. If you
are using an version of &os; earlier than 4.5, or you want to
manage it yourself you will want to set
<literal>maxusers</literal> to at least 4, especially if you are
using the X Window System or compiling software. The reason is that
the most important table set by <literal>maxusers</literal> is the
maximum number of processes, which is set to <literal>20 + 16 *
maxusers</literal>, so if you set <literal>maxusers</literal> to 1,
then you can only have 36 simultaneous processes, including the 18
or so that the system starts up at boot time and the 15 or so you
will probably create when you start the X Window System. Even a
simple task like reading a manual page will start up nine
processes to filter, decompress, and view it. Setting
<literal>maxusers</literal> to 64 will allow you to have up to 1044
simultaneous processes, which should be enough for nearly all uses.
If, however, you see the dreaded <errortype>proc table
full</errortype> error when trying to start another program, or are
running a server with a large number of simultaneous users (like
<hostid role="fqdn">ftp.FreeBSD.org</hostid>), you can always
increase the number and rebuild.</para>
<note>
<para><literal>maxusers</literal> does <emphasis>not</emphasis>
limit the number of users which can log into your machine. It
simply sets various table sizes to reasonable values considering
the maximum number of users you will likely have on your system
and how many processes each of them will be running. One keyword
which <emphasis>does</emphasis> limit the number of simultaneous
remote logins and X terminal windows is <link
linkend="kernelconfig-ptys"><literal>pseudo-device pty
16</literal></link>. With &os;&nbsp;5.X, you do not have to
worry about this number since the &man.pty.4; driver is
<quote>auto-cloning</quote>; you simply use the line
<literal>device pty</literal> in your configuration file.</para>
</note>
</sect3>

View file

@ -601,59 +601,6 @@ cpu I686_CPU</programlisting>
kernel, so it is useful to give the new kernel a different name if you
want to keep it separate from your usual kernel (e.g., you want to
build an experimental kernel).</para>
<indexterm>
<primary>kernel options</primary>
<secondary>maxusers</secondary>
</indexterm>
<programlisting>maxusers <replaceable>n</replaceable></programlisting>
<para>The <literal>maxusers</literal> option sets the size of a number
of important system tables. This number is supposed to be roughly
equal to the number of simultaneous users you expect to have on your
machine.</para>
<para>Starting with &os;&nbsp;4.5, the system will auto-tune this setting
for you if you explicitly set it to <literal>0</literal><footnote>
<para>The auto-tuning algorithm sets <literal>maxusers</literal> equal
to the amount of memory in the system, with a minimum of 32, and a
maximum of 384.</para></footnote>.
In &os;&nbsp;5.X and above, <literal>maxusers</literal> will default to
<literal>0</literal> if not specified. If you are using an
version of &os; earlier than 4.5, or you want to manage it
yourself you will want to set
<literal>maxusers</literal> to at least 4, especially if you are
using the X Window System or compiling software. The reason is that
the most important table set by <literal>maxusers</literal> is the
maximum number of processes, which is set to <literal>20 + 16 *
maxusers</literal>, so if you set <literal>maxusers</literal> to 1,
then you can only have 36 simultaneous processes, including the 18
or so that the system starts up at boot time and the 15 or so you
will probably create when you start the X Window System. Even a
simple task like reading a manual page will start up nine processes to
filter, decompress, and view it. Setting
<literal>maxusers</literal> to 64 will allow you to have up to 1044
simultaneous processes, which should be enough for nearly all uses.
If, however, you see the dreaded <errortype>proc table
full</errortype> error when trying to start another program, or are
running a server with a large number of simultaneous users (like
<hostid role="fqdn">ftp.FreeBSD.org</hostid>), you can always
increase the number and rebuild.</para>
<note>
<para><literal>maxusers</literal> does <emphasis>not</emphasis>
limit the number of users which can log into your machine. It
simply sets various table sizes to reasonable values considering
the maximum number of users you will likely have on your system
and how many processes each of them will be running. One keyword
which <emphasis>does</emphasis> limit the number of simultaneous
remote logins and X terminal windows is <link
linkend="kernelconfig-ptys"><literal>pseudo-device pty
16</literal></link>. With &os;&nbsp;5.X, you do not have to
worry about this number since the &man.pty.4; driver is
<quote>auto-cloning</quote>; you simply use the line
<literal>device pty</literal> in your configuration file.</para>
</note>
<programlisting># Floating point support - do not disable.
device npx</programlisting>