From 0e9a484f2a45a97aa1f8cedf7bf18f8c5259cd64 Mon Sep 17 00:00:00 2001
From: Luca Toscano AsyncRequestWorkerFactor
.
This mpm showed some scalability bottlenecks in the past leading to the following
+ error: "scoreboard is full, not at MaxRequestWorkers".
+ MaxRequestWorkers
+ limits the number of simultaneous requests that will be served at any given time
+ and also the number of allowed processes
+ (MaxRequestWorkers
+ / ThreadsPerChild
), meanwhile
+ the Scoreboard 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 MaxRequestWorkers
,
+ 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
+ ListenBacklog
). 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 safely terminate and free up a
+ scoreboard slot (for example handling long running requests, slow clients
+ or connections with keep-alive enabled). Two scenarios are very common:
MaxSpareThreads
).
+ This is particularly problematic because when the load increases again,
+ httpd will try to start new processes.
+ If the pattern repeats, the number of processes can rise quite a bit,
+ ending up in a mixture of old processes trying to stop and new ones
+ trying to do some work.
+ 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:
+ServerLimit
.
+ MaxRequestWorkers
and
+ ThreadsPerChild
are used
+ to limit the amount of active processes, meanwhile
+ ServerLimit
+ takes also into account the ones doing a graceful
+ close to allow extra slots when needed. The idea is to use
+ ServerLimit
to instruct httpd
+ about how many overall processes are tolerated before impacting
+ the system resources.
+ The behavior described in the last point is completely observable via
+ mod_status
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.
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
worker
MPM and reserve one worker thread per connection.
All modules shipped with the server are compatible with the event MPM.