]> granicus.if.org Git - apache/blob - docs/manual/mod/event.xml
Rebuild transformations.
[apache] / docs / manual / mod / event.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
5
6 <!--
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
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
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.
21 -->
22
23 <modulesynopsis metafile="event.xml.meta">
24 <name>event</name>
25 <description>A variant of the <module>worker</module> MPM with the goal
26 of consuming threads only for connections with active processing</description>
27 <status>MPM</status>
28 <sourcefile>event.c</sourcefile>
29 <identifier>mpm_event_module</identifier>
30
31 <summary>
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>
40
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>
44
45 </summary>
46
47 <seealso><a href="worker.html">The worker MPM</a></seealso>
48
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
58     state.</p>
59
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>
65
66 </section>
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>
77
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
80     moot.</p>
81
82     <ul>
83     
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>
87
88       <li>For NetBSD, at least version 2.0 is recommended.</li>
89
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>
93
94     </ul>
95 </section>
96
97 <directivesynopsis location="mpm_common"><name>CoreDumpDirectory</name>
98 </directivesynopsis>
99 <directivesynopsis location="mpm_common"><name>EnableExceptionHook</name>
100 </directivesynopsis>
101 <directivesynopsis location="mpm_common"><name>Group</name>
102 </directivesynopsis>
103 <directivesynopsis location="mpm_common"><name>Listen</name>
104 </directivesynopsis>
105 <directivesynopsis location="mpm_common"><name>ListenBacklog</name>
106 </directivesynopsis>
107 <directivesynopsis location="mpm_common"><name>SendBufferSize</name>
108 </directivesynopsis>
109 <directivesynopsis location="mpm_common"><name>MaxClients</name>
110 </directivesynopsis>
111 <directivesynopsis location="mpm_common"><name>MaxMemFree</name>
112 </directivesynopsis>
113 <directivesynopsis location="mpm_common"><name>MaxConnectionsPerChild</name>
114 </directivesynopsis>
115 <directivesynopsis location="mpm_common"><name>MaxSpareThreads</name>
116 </directivesynopsis>
117 <directivesynopsis location="mpm_common"><name>MinSpareThreads</name>
118 </directivesynopsis>
119 <directivesynopsis location="mpm_common"><name>PidFile</name>
120 </directivesynopsis>
121 <directivesynopsis location="mpm_common"><name>ScoreBoardFile</name>
122 </directivesynopsis>
123 <directivesynopsis location="mpm_common"><name>ServerLimit</name>
124 </directivesynopsis>
125 <directivesynopsis location="mpm_common"><name>StartServers</name>
126 </directivesynopsis>
127 <directivesynopsis location="mpm_common"><name>ThreadLimit</name>
128 </directivesynopsis>
129 <directivesynopsis location="mpm_common"><name>ThreadsPerChild</name>
130 </directivesynopsis>
131 <directivesynopsis location="mpm_common"><name>ThreadStackSize</name>
132 </directivesynopsis>
133 <directivesynopsis location="mpm_common"><name>User</name>
134 </directivesynopsis>
135
136 </modulesynopsis>