<p>The <code class="directive">AcceptMutex</code> directives sets the
method that Apache uses to serialize multiple children accepting
requests on network sockets. Prior to Apache 2.0, the method was
selectable only at compile time. The optimal method to use is
highly architecture and platform dependent. For further details,
see the <a href="../misc/perf-tuning.html">performance tuning</a>
documentation.</p>
<p>If this directive is set to <code>Default</code>, then the
compile-time selected default will be used. Other possible
methods are listed below. Note that not all methods are
available on all platforms. If a method is specified which is
not available, a message will be written to the error log
listing the available methods.</p>
<dl>
<dt><code>flock</code></dt>
<dd>uses the <code>flock(2)</code> system call to lock the
file defined by the <code class="directive"><a href="#lockfile">LockFile</a></code> directive.</dd>
<dt><code>fcntl</code></dt>
<dd>uses the <code>fcntl(2)</code> system call to lock the
file defined by the <code class="directive"><a href="#lockfile">LockFile</a></code> directive.</dd>
<dt><code>posixsem</code></dt>
<dd>uses POSIX compatible semaphores to implement the mutex.</dd>
<dt><code>pthread</code></dt>
<dd>uses POSIX mutexes as implemented by the POSIX Threads
(PThreads) specification.</dd>
<dt><code>sysvsem</code></dt>
<dd>uses SySV-style semaphores to implement the mutex.</dd>
</dl>
<p>If you want to find out the compile time chosen default
for your system, you may set your <code class="directive"><a href="../mod/core.html#loglevel">LogLevel</a></code> to <code>debug</code>. Then the default <code class="directive">AcceptMutex</code> will be written into the <code class="directive"><a href="../mod/core.html#errorlog">ErrorLog</a></code>.</p>
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Only valid in global server config since Apache
2.0</td></tr>
</table>
<p>The <code class="directive">Group</code> directive sets the group under
which the server will answer requests. In order to use this
directive, the server must be run initially as <code>root</code>. If
you start the server as a non-root user, it will fail to change to the
specified group, and will instead continue to run as the group of the
original user. <var>Unix-group</var> is one of:</p>
<dl>
<dt>A group name</dt>
<dd>Refers to the given group by name.</dd>
<dt><code>#</code> followed by a group number.</dt>
<dd>Refers to a group by its number.</dd>
</dl>
<div class="example"><h3>Example</h3><p><code>
Group www-group
</code></p></div>
<p>It is recommended that you set up a new group specifically for
running the server. Some admins use user <code>nobody</code>,
but this is not always possible or desirable.</p>
<div class="warning"><h3>Security</h3>
<p>Don't set <code class="directive">Group</code> (or <code class="directive"><a href="#user">User</a></code>) to <code>root</code> unless
you know exactly what you are doing, and what the dangers are.</p>
</div>
<p>Special note: Use of this directive in <code class="directive"><a href="../mod/core.html#virtualhost"><VirtualHost></a></code> is no longer supported. To
configure your server for <a href="mod_suexec.html">suexec</a> use
<p>Although the <code class="directive">Group</code> directive is present
in the <code class="module"><a href="../mod/beos.html">beos</a></code> and <code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code> MPMs,
it is actually a no-op there and only exists for compatibility
<p>For threaded and hybrid servers (<em>e.g.</em> <code class="module"><a href="../mod/beos.html">beos</a></code>
or <code class="module"><a href="../mod/worker.html">worker</a></code>) <code class="directive">MaxClients</code> restricts
the total number of threads that will be available to serve clients.
The default value for <code class="module"><a href="../mod/beos.html">beos</a></code> is <code>50</code>. For
hybrid MPMs the default value is <code>16</code> (<code class="directive"><a href="#serverlimit">ServerLimit</a></code>) multiplied by the value of
<code>25</code> (<code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code>). Therefore, to increase <code class="directive">MaxClients</code> to a value that requires more than 16 processes,
you must also raise <code class="directive"><a href="#serverlimit">ServerLimit</a></code>.</p>
<p>Maximum number of idle threads. Different MPMs deal with this
directive differently.</p>
<p>For <code class="module"><a href="../mod/perchild.html">perchild</a></code> the default is
<code>MaxSpareThreads 10</code>. This MPM monitors the number of
idle threads on a per-child basis. If there are too many idle
threads in that child, the server will begin to kill threads
within that child.</p>
<p>For <code class="module"><a href="../mod/worker.html">worker</a></code>, <code class="module"><a href="../mod/leader.html">leader</a></code> and <code class="module"><a href="../mod/threadpool.html">threadpool</a></code> the default is <code>MaxSpareThreads 250</code>.
These MPMs deal with idle threads on a server-wide basis. If there
are too many idle threads in the server then child processes are
killed until the number of idle threads is less than this number.</p>
<p>For <code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code> the default is
<code>MaxSpareThreads 100</code>. Since this MPM runs a
single-process, the spare thread count is also server-wide.</p>
<p><code class="module"><a href="../mod/beos.html">beos</a></code> and <code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code> work
similar to <code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code>. The default for
<code class="module"><a href="../mod/beos.html">beos</a></code> is <code>MaxSpareThreads 50</code>. For
<code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code> the default value is <code>10</code>.</p>
<div class="note"><h3>Restrictions</h3>
<p>The range of the <code class="directive">MaxSpareThreads</code> value
is restricted. Apache will correct the given value automatically
according to the following rules:</p>
<ul>
<li><code class="module"><a href="../mod/perchild.html">perchild</a></code> requires <code class="directive">MaxSpareThreads</code> to be less or equal than <code class="directive"><a href="#threadlimit">ThreadLimit</a></code>.</li>
<li><code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code> wants the value to be greater than
<p>Minimum number of idle threads to handle request spikes.
Different MPMs deal with this directive
differently.</p>
<p><code class="module"><a href="../mod/perchild.html">perchild</a></code> uses a default of
<code>MinSpareThreads 5</code> and monitors the number of idle
threads on a per-child basis. If there aren't enough idle threads
in that child, the server will begin to create new threads within
that child. Thus, if you set <code class="directive"><a href="../mod/perchild.html#numservers">NumServers</a></code> to <code>10</code> and a <code class="directive">MinSpareThreads</code> value of <code>5</code>, you'll have
at least 50 idle threads on your system.</p>
<p><code class="module"><a href="../mod/worker.html">worker</a></code>, <code class="module"><a href="../mod/leader.html">leader</a></code> and
<code class="module"><a href="../mod/threadpool.html">threadpool</a></code> use a default of <code>MinSpareThreads
75</code> and deal with idle threads on a server-wide basis. If
there aren't enough idle threads in the server then child
processes are created until the number of idle threads is greater
than number.</p>
<p><code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code> uses a default of
<code>MinSpareThreads 10</code> and, since it is a single-process
MPM, tracks this on a server-wide bases.</p>
<p><code class="module"><a href="../mod/beos.html">beos</a></code> and <code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code> work
similar to <code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code>. The default for
<code class="module"><a href="../mod/beos.html">beos</a></code> is <code>MinSpareThreads 1</code>. For
<code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code> the default value is <code>5</code>.</p>
<p>It is often useful to be able to send the server a signal,
so that it closes and then re-opens its <code class="directive"><a href="../mod/core.html#errorlog">ErrorLog</a></code> and <code class="directive"><a href="../mod/mod_log_config.html#transferlog">TransferLog</a></code>, and
re-reads its configuration files. This is done by sending a
SIGHUP (kill -1) signal to the process id listed in the
<code class="directive">PidFile</code>.</p>
<p>The <code class="directive">PidFile</code> is subject to the same
warnings about log file placement and <a href="../misc/security_tips.html#serverroot">security</a>.</p>
<div class="note"><h3>Note</h3>
<p>As of Apache 2 it is recommended to use only the <a href="../programs/apachectl.html">apachectl</a> script for
settings require more than 16 server processes (default). Do not set
the value of this directive any higher than the number of server
processes required by what you may want for <code class="directive"><a href="#maxclients ">MaxClients </a></code> and <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code>.</p>
<p>With the <code class="module"><a href="../mod/perchild.html">perchild</a></code> MPM, use this directive only
if you need to set <code class="directive"><a href="../mod/perchild.html#numservers">NumServers</a></code> higher than 8 (default).</p>
<div class="note"><h3>Note</h3>
<p>There is a hard limit of <code>ServerLimit 20000</code> compiled
into the server. This is intended to avoid nasty effects caused by
typos.</p>
</div>
<h3>See also</h3>
<ul>
<li><a href="../stopping.html">Stopping and Restarting Apache</a></li>
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available for <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code> in Apache 2.0.41
and later</td></tr>
</table>
<p>This directive sets the maximum configured value for <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> for the lifetime
of the Apache process. Any attempts to change this directive
during a restart will be ignored, but <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> can be modified
during a restart up to the value of this directive.</p>
<p>Special care must be taken when using this directive. If
<code class="directive">ThreadLimit</code> is set to a value much higher
than <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code>,
extra unused shared memory will be allocated. If both
<code class="directive">ThreadLimit</code> and <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> are set to values
higher than the system can handle, Apache may not start or the
system may become unstable. Do not set the value of this directive
any higher than your greatest predicted setting of <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> for the
current run of Apache.</p>
<p>The default value for <code class="directive">ThreadLimit</code> is
<code>1920</code> when used with <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code> and
<code>64</code> when used with the others.</p>
<div class="note"><h3>Note</h3>
<p>There is a hard limit of <code>ThreadLimit 20000</code> (or
<code>ThreadLimit 15000</code> with <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code>)
compiled into the server. This is intended to avoid nasty effects
<p>Special note: Use of this directive in <code class="directive"><a href="../mod/core.html#virtualhost"><VirtualHost></a></code> is no longer supported. To
configure your server for <a href="../suexec.html">suexec</a> use
<p>Although the <code class="directive">User</code> directive is present
in the <code class="module"><a href="../mod/beos.html">beos</a></code> and <code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code> MPMs,
it is actually a no-op there and only exists for compatibility
reasons.</p>
</div>
</div>
</div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="../de/mod/mpm_common.html" hreflang="de" rel="alternate" title="Deutsch"> de </a> |
<a href="../en/mod/mpm_common.html" title="English"> en </a> |
<a href="../ja/mod/mpm_common.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
</div><div id="footer">
<p class="apache">Copyright 1999-2004 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>