summaryrefslogtreecommitdiffstats
path: root/docs/manual/mod/event.xml
diff options
context:
space:
mode:
authorLuca Toscano <elukey@apache.org>2016-12-02 15:56:50 +0100
committerLuca Toscano <elukey@apache.org>2016-12-02 15:56:50 +0100
commit11bb63ef4aeccc7ebe89ed5cbe8419ad571d1e39 (patch)
treec2a102734daf2e3c2fdcbb9ad060875b9c53aaa3 /docs/manual/mod/event.xml
parentadd mod_proxy_hcheck to legacy build (diff)
downloadapache2-11bb63ef4aeccc7ebe89ed5cbe8419ad571d1e39.tar.xz
apache2-11bb63ef4aeccc7ebe89ed5cbe8419ad571d1e39.zip
Add a section to mpm-event's documentation to advertise new changes
I tried to add a summary of Stefan's last patches just backported to 2.4.x today. I've read all of them and tried to report Stefan's comment from PR 53555 as much as possible. Please review and let me know if I wrong something incorrect or not precise enough. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1772357 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'docs/manual/mod/event.xml')
-rw-r--r--docs/manual/mod/event.xml52
1 files changed, 51 insertions, 1 deletions
diff --git a/docs/manual/mod/event.xml b/docs/manual/mod/event.xml
index 7ea5872105..33fb808ae2 100644
--- a/docs/manual/mod/event.xml
+++ b/docs/manual/mod/event.xml
@@ -104,10 +104,60 @@ of the <directive>AsyncRequestWorkerFactor</directive>.</p>
</section>
+ <section id="graceful-close"><title>Graceful process termination and Scoreboard usage</title>
+ <p>This mpm showed some scalability bottlenecks in the past leading to the following
+ error: "<strong>scoreboard is full, not at MaxRequestWorkers</strong>".
+ <directive module="mpm_common">MaxRequestWorkers</directive>
+ limits the number of simultaneous requests that will be served at any given time
+ and also the number of allowed processes
+ (<directive module="mpm_common">MaxRequestWorkers</directive>
+ / <directive module="mpm_common">ThreadsPerChild</directive>), meanwhile
+ the Scoreboad is a representation of all the running processes and
+ the status of their worker threads. If the scoreboard is full (so all the
+ threads have a state that is not idle) but the number of active requests
+ served is not <directive module="mpm_common">MaxRequestWorkers</directive>,
+ it means that some of them are blocking new requests that could be served
+ but that are queued instead (up to the limit imposed by
+ <directive module="mpm_common">ListenBacklog</directive>). Most of the times
+ the threads are stuck in the Graceful state, namely they are waiting to
+ finish their work with a TCP connection to terminate and free a
+ scoreboard slot (for example handling long running requests, slow clients
+ or a connection with keep-alive enabled). Two scenarios are very common:</p>
+ <ul>
+ <li>Httpd graceful restart.</li>
+ <li>When the server load goes down in a way that causes httpd to
+ stop some processes (for example due to
+ <directive module="mpm_common">MaxSpareThreads</directive>).
+ This is particularly problematic because when the load increases again,
+ httpd will try to start more processes.
+ If the pattern repeats, the number of processes can rise quite a bit.
+ </li>
+ </ul>
+ <p>From 2.4.24 onward, mpm-event is smarter and it is able to handle
+ graceful terminations in a much better way. Some of the improvements are:</p>
+ <ul>
+ <li>Allow the use of all the scoreboard slots up to
+ <directive module="mpm_common">ServerLimit</directive>.</li>
+ <li>Force gracefully finishing processes to close their
+ connections in keep-alive state.</li>
+ <li>During graceful shutdown, if there are more running worker threads
+ than open connections for a given process, terminate these threads to
+ free resources faster (which may be needed for new processes).</li>
+ <li>If the scoreboard is full, prevent more processes to finish
+ gracefully due to reduced load until old processes have terminated
+ (otherwise the situation would get worse once the load increases again).</li>
+ </ul>
+ <p>The behavior described in the last point is completely observable via
+ <module>mod_status</module> in the connection summary table through two new
+ columns: "Slot" and "Stopping". The former indicates the PID and
+ the latter if the process is stopping or not; the extra state "Yes (old gen)"
+ indicates a process still running after a graceful restart.</p>
+ </section>
+
<section id="limitations"><title>Limitations</title>
<p>The improved connection handling may not work for certain connection
filters that have declared themselves as incompatible with event. In these
- cases, this MPM will fall back to the behaviour of the
+ cases, this MPM will fall back to the behavior of the
<module>worker</module> MPM and reserve one worker thread per connection.
All modules shipped with the server are compatible with the event MPM.</p>