2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
7 Licensed to the Apache Software Foundation (ASF) under one or more
8 contributor license agreements. See the NOTICE file distributed with
9 this work for additional information regarding copyright ownership.
10 The ASF licenses this file to You under the Apache License, Version 2.0
11 (the "License"); you may not use this file except in compliance with
12 the License. You may obtain a copy of the License at
14 http://www.apache.org/licenses/LICENSE-2.0
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
23 <modulesynopsis metafile="event.xml.meta">
25 <description>A variant of the <module>worker</module> MPM with the goal
26 of consuming threads only for connections with active processing</description>
28 <sourcefile>event.c</sourcefile>
29 <identifier>mpm_event_module</identifier>
32 <p>The <module>event</module> Multi-Processing Module (MPM) is
33 designed to allow more requests to be served simultaneously by
34 passing off some processing work to supporting threads, freeing up
35 the main threads to work on new requests. It is based on the
36 <module>worker</module> MPM, which implements a hybrid
37 multi-process multi-threaded server. Run-time configuration
38 directives are identical to those provided by
39 <module>worker</module>.</p>
41 <p>To use the <module>event</module> MPM, add
42 <code>--with-mpm=event</code> to the <program>configure</program>
43 script's arguments when building the <program>httpd</program>.</p>
47 <seealso><a href="worker.html">The worker MPM</a></seealso>
49 <section id="how-it-works"><title>How it Works</title>
50 <p>This MPM tries to fix the 'keep alive problem' in HTTP. After a client
51 completes the first request, the client can keep the connection
52 open, and send further requests using the same socket. This can
53 save signifigant overhead in creating TCP connections. However,
54 Apache HTTP Server traditionally keeps an entire child process/thread waiting
55 for data from the client, which brings its own disadvantages. To
56 solve this problem, this MPM uses a dedicated thread to handle both
57 the Listening sockets, and all sockets that are in a Keep Alive
60 <p>The MPM assumes that the underlying <code>apr_pollset</code>
61 implementation is reasonably threadsafe. This enables the MPM to
62 avoid excessive high level locking, or having to wake up the listener
63 thread in order to send it a keep-alive socket. This is currently
64 only compatible with KQueue and EPoll.</p>
67 <section id="requirements"><title>Requirements</title>
68 <p>This MPM depends on <glossary>APR</glossary>'s atomic
69 compare-and-swap operations for thread synchronization. If you are
70 compiling for an x86 target and you don't need to support 386s, or
71 you are compiling for a SPARC and you don't need to run on
72 pre-UltraSPARC chips, add
73 <code>--enable-nonportable-atomics=yes</code> to the
74 <program>configure</program> script's arguments. This will cause
75 APR to implement atomic operations using efficient opcodes not
76 available in older CPUs.</p>
78 <p>This MPM does not perform well on older platforms which lack good
79 threading, but the requirement for EPoll or KQueue makes this
84 <li>To use this MPM on FreeBSD, FreeBSD 5.3 or higher is recommended.
85 However, it is possible to run this MPM on FreeBSD 5.2.1, if you
86 use <code>libkse</code> (see <code>man libmap.conf</code>).</li>
88 <li>For NetBSD, at least version 2.0 is recommended.</li>
90 <li>For Linux, a 2.6 kernel is recommended. It is also necessary to
91 ensure that your version of <code>glibc</code> has been compiled
92 with support for EPoll.</li>
97 <directivesynopsis location="mpm_common"><name>CoreDumpDirectory</name>
99 <directivesynopsis location="mpm_common"><name>EnableExceptionHook</name>
101 <directivesynopsis location="mpm_common"><name>Group</name>
103 <directivesynopsis location="mpm_common"><name>Listen</name>
105 <directivesynopsis location="mpm_common"><name>ListenBacklog</name>
107 <directivesynopsis location="mpm_common"><name>SendBufferSize</name>
109 <directivesynopsis location="mpm_common"><name>MaxClients</name>
111 <directivesynopsis location="mpm_common"><name>MaxMemFree</name>
113 <directivesynopsis location="mpm_common"><name>MaxConnectionsPerChild</name>
115 <directivesynopsis location="mpm_common"><name>MaxSpareThreads</name>
117 <directivesynopsis location="mpm_common"><name>MinSpareThreads</name>
119 <directivesynopsis location="mpm_common"><name>PidFile</name>
121 <directivesynopsis location="mpm_common"><name>ScoreBoardFile</name>
123 <directivesynopsis location="mpm_common"><name>ServerLimit</name>
125 <directivesynopsis location="mpm_common"><name>StartServers</name>
127 <directivesynopsis location="mpm_common"><name>ThreadLimit</name>
129 <directivesynopsis location="mpm_common"><name>ThreadsPerChild</name>
131 <directivesynopsis location="mpm_common"><name>ThreadStackSize</name>
133 <directivesynopsis location="mpm_common"><name>User</name>