worker.xml revision e6469ad7a7dacf318f7ecf393b448b83ad1fdb37
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<?xml version="1.0"?>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<?xml-stylesheet type="text/xsl" href="/style/manual.xsl"?>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<modulesynopsis>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<name>worker</name>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<description>Multi-Processing Module implementing a hybrid
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive multi-threaded multi-process web server</description>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<status>MPM</status>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<sourcefile>worker.c</sourcefile>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<identifier>mpm_worker_module</identifier>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<summary>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive <p>This Multi-Processing Module (MPM) is the default for most
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive unix-like operating systems. It implements a hybrid
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive multi-process multi-threaded server. Each process has a fixed
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive number of threads. The server adjusts to handle load by
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive increasing or decreasing the number of processes.</p>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive <p>A single control process is responsible for launching child
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive processes. Each child process creates a fixed number of threads
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive as specified in the <code>ThreadsPerChild</code> directive. The
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive individual threads then listen for connections and serve them
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive when they arrive.</p>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive <p>Apache always tries to maintain a pool of <em>spare</em> or
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive idle server threads, which stand ready to serve incoming
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive requests. In this way, clients do not need to wait for a new
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive threads or processes to be created before their requests can be
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive served. Apache assesses the total number of idle threads in all
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive processes, and forks or kills processes to keep this number
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive within the boundaries specified by <code>MinSpareThreads</code>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive and <code>MaxSpareThreads</code>. Since this process is very
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive self-regulating, it is rarely necessary to modify these
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive directives from their default values. The maximum number of
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive clients that may be served simultaneously is determined by
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive multiplying the maximum number of server processes that will be
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive created (<code>MaxClients</code>) by the number of threads
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive created in each process (<code>ThreadsPerChild</code>).</p>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive <p>While the parent process is usually started as root under
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive Unix in order to bind to port 80, the child processes and
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive threads are launched by Apache as a less-privileged user. The
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive <code>User</code> and <code>Group</code> directives are used to
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive set the privileges of the Apache child processes. The child
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive processes must be able to read all the content that will be
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive served, but should have as few privileges beyond that as
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive possible. In addition, unless <a
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive href="/suexec.html">suexec</a> is used, these directives also
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive set the privileges which will be inherited by CGI scripts.</p>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive <p><code>MaxRequestsPerChild</code> controls how frequently the
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive server recycles processes by killing old ones and launching new
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive ones.</p>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive <p>See also: <a href="/bind.html">Setting which addresses and
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive ports Apache uses</a>.</p>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive</summary>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<directivesynopsis location="mpm_common"><name>CoreDumpDirectory</name>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive</directivesynopsis>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<directivesynopsis location="mpm_common"><name>Group</name>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive</directivesynopsis>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<directivesynopsis location="mpm_common"><name>PidFile</name>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive</directivesynopsis>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<directivesynopsis location="mpm_common"><name>Listen</name>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive</directivesynopsis>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<directivesynopsis location="mpm_common"><name>ListenBacklog</name>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive</directivesynopsis>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<directivesynopsis location="mpm_common"><name>LockFile</name>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive</directivesynopsis>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<directivesynopsis location="mpm_common"><name>MaxClients</name>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive</directivesynopsis>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<directivesynopsis location="mpm_common"><name>MaxRequestsPerChild</name>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive</directivesynopsis>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<directivesynopsis location="mpm_common"><name>MaxSpareThreads</name>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive</directivesynopsis>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<directivesynopsis location="mpm_common"><name>MinSpareThreads</name>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive</directivesynopsis>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<directivesynopsis location="mpm_common"><name>ScoreBoardFile</name>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive</directivesynopsis>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<directivesynopsis location="mpm_common"><name>SendBufferSize</name>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive</directivesynopsis>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<directivesynopsis location="mpm_common"><name>ServerLimit</name>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive</directivesynopsis>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<directivesynopsis location="mpm_common"><name>StartServers</name>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive</directivesynopsis>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<directivesynopsis location="mpm_common"><name>ThreadLimit</name>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive</directivesynopsis>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<directivesynopsis location="mpm_common"><name>ThreadsPerChild</name>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive</directivesynopsis>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive<directivesynopsis location="mpm_common"><name>User</name>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive</directivesynopsis>
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive
e6469ad7a7dacf318f7ecf393b448b83ad1fdb37slive</modulesynopsis>