event.xml revision 188a5ef97e793cb79096d1297a37747b1de03457
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<!-- $LastChangedRevision$ -->
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding Licensed to the Apache Software Foundation (ASF) under one or more
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding contributor license agreements. See the NOTICE file distributed with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding this work for additional information regarding copyright ownership.
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding The ASF licenses this file to You under the Apache License, Version 2.0
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding (the "License"); you may not use this file except in compliance with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding the License. You may obtain a copy of the License at
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna Unless required by applicable law or agreed to in writing, software
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna distributed under the License is distributed on an "AS IS" BASIS,
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna See the License for the specific language governing permissions and
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna limitations under the License.
7677dd9b01d498a2af1cddb8e2506a25d7da630btrawick<description>A variant of the <module>worker</module> MPM with the goal
7677dd9b01d498a2af1cddb8e2506a25d7da630btrawickof consuming threads only for connections with active processing</description>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive <p>The <module>event</module> Multi-Processing Module (MPM) is
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive designed to allow more requests to be served simultaneously by
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive passing off some processing work to supporting threads, freeing up
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive the main threads to work on new requests. It is based on the
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive <module>worker</module> MPM, which implements a hybrid
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive multi-process multi-threaded server. Run-time configuration
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive directives are identical to those provided by
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna <code>--with-mpm=event</code> to the <program>configure</program>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna script's arguments when building the <program>httpd</program>.</p>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive<seealso><a href="worker.html">The worker MPM</a></seealso>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive <p>This MPM tries to fix the 'keep alive problem' in HTTP. After a client
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive completes the first request, the client can keep the connection
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive open, and send further requests using the same socket. This can
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive save signifigant overhead in creating TCP connections. However,
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive Apache HTTP Server traditionally keeps an entire child process/thread waiting
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive for data from the client, which brings its own disadvantages. To
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive solve this problem, this MPM uses a dedicated thread to handle both
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive the Listening sockets, all sockets that are in a Keep Alive state,
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive and sockets where the handler and protocol filters have done their work
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive and the only remaining thing to do is send the data to the client. The
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive status page of <module>mod_status</module> shows how many connections are
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive in the mentioned states.</p>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive <p>The improved connection handling does not yet work for certain
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive connection filters, in particular SSL. For SSL connections, this MPM will
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive fall back to the behaviour of the <module>worker</module> MPM and
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive reserve one worker thread per connection.</p>
1d9308ed0075062953a246d16bcda888a1be1adeslive <p>The MPM assumes that the underlying <code>apr_pollset</code>
1d9308ed0075062953a246d16bcda888a1be1adeslive implementation is reasonably threadsafe. This enables the MPM to
1d9308ed0075062953a246d16bcda888a1be1adeslive avoid excessive high level locking, or having to wake up the listener
1d9308ed0075062953a246d16bcda888a1be1adeslive thread in order to send it a keep-alive socket. This is currently
1d9308ed0075062953a246d16bcda888a1be1adeslive only compatible with KQueue and EPoll.</p>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive <p>This MPM depends on <glossary>APR</glossary>'s atomic
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive compare-and-swap operations for thread synchronization. If you are
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive compiling for an x86 target and you don't need to support 386s, or
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive you are compiling for a SPARC and you don't need to run on
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive pre-UltraSPARC chips, add
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive <program>configure</program> script's arguments. This will cause
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive APR to implement atomic operations using efficient opcodes not
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive available in older CPUs.</p>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive <p>This MPM does not perform well on older platforms which lack good
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive threading, but the requirement for EPoll or KQueue makes this
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive <li>To use this MPM on FreeBSD, FreeBSD 5.3 or higher is recommended.
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive However, it is possible to run this MPM on FreeBSD 5.2.1, if you
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive use <code>libkse</code> (see <code>man libmap.conf</code>).</li>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive <li>For NetBSD, at least version 2.0 is recommended.</li>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna <li>For Linux, a 2.6 kernel is recommended. It is also necessary to
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna ensure that your version of <code>glibc</code> has been compiled
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna with support for EPoll.</li>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>CoreDumpDirectory</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>EnableExceptionHook</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>Group</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>Listen</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>ListenBacklog</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>SendBufferSize</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>MaxRequestWorkers</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>MaxMemFree</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>MaxConnectionsPerChild</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>MaxSpareThreads</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>MinSpareThreads</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>PidFile</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>ScoreBoardFile</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>ServerLimit</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>StartServers</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>ThreadLimit</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>ThreadsPerChild</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>ThreadStackSize</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>