event.xml revision 7677dd9b01d498a2af1cddb8e2506a25d7da630b
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<?xml version="1.0"?>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<!-- $LastChangedRevision$ -->
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<!--
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
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna http://www.apache.org/licenses/LICENSE-2.0
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna
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.
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna-->
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<modulesynopsis metafile="event.xml.meta">
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<name>event</name>
7677dd9b01d498a2af1cddb8e2506a25d7da630btrawick<description>A variant of the <module>worker</module> MPM with the goal
7677dd9b01d498a2af1cddb8e2506a25d7da630btrawickof consuming threads only for connections with active processing</description>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<status>MPM</status>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<sourcefile>event.c</sourcefile>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<identifier>mpm_event_module</identifier>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<summary>
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
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive <module>worker</module>.</p>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna <p>To use the <module>event</module> MPM, add
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna <code>--with-mpm=event</code> to the <program>configure</program>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna script's arguments when building the <program>httpd</program>.</p>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive</summary>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive<seealso><a href="worker.html">The worker MPM</a></seealso>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive<section id="how-it-works"><title>How it Works</title>
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,
381b101317d64df9ce37f788d903a999f9f26ca7rbowen Apache 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
188a5ef97e793cb79096d1297a37747b1de03457sf the Listening sockets, and all sockets that are in a Keep Alive
188a5ef97e793cb79096d1297a37747b1de03457sf state.</p>
188a5ef97e793cb79096d1297a37747b1de03457sf
188a5ef97e793cb79096d1297a37747b1de03457sf <p>The MPM assumes that the underlying <code>apr_pollset</code>
188a5ef97e793cb79096d1297a37747b1de03457sf implementation is reasonably threadsafe. This enables the MPM to
188a5ef97e793cb79096d1297a37747b1de03457sf avoid excessive high level locking, or having to wake up the listener
188a5ef97e793cb79096d1297a37747b1de03457sf thread in order to send it a keep-alive socket. This is currently
188a5ef97e793cb79096d1297a37747b1de03457sf only compatible with KQueue and EPoll.</p>
188a5ef97e793cb79096d1297a37747b1de03457sf
188a5ef97e793cb79096d1297a37747b1de03457sf</section>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive<section id="requirements"><title>Requirements</title>
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 <code>--enable-nonportable-atomics=yes</code> to the
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive <program>configure</program> script's arguments. This will cause
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive APR to implement atomic operations using efficient opcodes not
1d9308ed0075062953a246d16bcda888a1be1adeslive available in older CPUs.</p>
1d9308ed0075062953a246d16bcda888a1be1adeslive
1d9308ed0075062953a246d16bcda888a1be1adeslive <p>This MPM does not perform well on older platforms which lack good
1d9308ed0075062953a246d16bcda888a1be1adeslive threading, but the requirement for EPoll or KQueue makes this
1d9308ed0075062953a246d16bcda888a1be1adeslive moot.</p>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna <ul>
1d9308ed0075062953a246d16bcda888a1be1adeslive
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
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive <li>For NetBSD, at least version 2.0 is recommended.</li>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive <li>For Linux, a 2.6 kernel is recommended. It is also necessary to
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive ensure that your version of <code>glibc</code> has been compiled
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive with support for EPoll.</li>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive </ul>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive</section>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive<directivesynopsis location="mpm_common"><name>AcceptMutex</name>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive</directivesynopsis>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive<directivesynopsis location="mpm_common"><name>CoreDumpDirectory</name>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive</directivesynopsis>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive<directivesynopsis location="mpm_common"><name>EnableExceptionHook</name>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive</directivesynopsis>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive<directivesynopsis location="mpm_common"><name>Group</name>
57758b7ebacbd303cb1c004dd67dd8e5cc1055dbslive</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>LockFile</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>MaxClients</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>MaxMemFree</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
3fa816e4832a1c70600bdfd6fc5ef60e9f1c18bbsf<directivesynopsis location="mpm_common"><name>MaxRequestsPerChild</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>MaxSpareThreads</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
be192cefa381d5bae6868034687471754cb43175sf<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>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna<directivesynopsis location="mpm_common"><name>User</name>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</directivesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna</modulesynopsis>
ea8572f0df1c69b398e9d677648a0fa5f31b2d60pquerna