I need some assistance with tuning Apache with event MPM.
The Apache server in consideration is running an application module. The current MPM settings are -
<IfModule mpm_event_module>
StartServers 2
ServerLimit 4
MinSpareThreads 60
MaxSpareThreads 240
MaxClients 240
ThreadsPerChild 60
MaxRequestWorkers 240
MaxConnectionsPerChild 0
MaxRequestsPerChild 0
</IfModule>
This means that there are 240 threads available to work on 240 established connections.
The AsyncRequestWorkerFactor for event MPM is 2 by default.
The process will accept new connections only when current number of connections is lower than ThreadsPerChild
+
(AsyncRequestWorkerFactor
*
number of idle workers)
Assuming the server is always under
heavy load, the 240 worker threads are busy working on 240 requests from
240 established connections. As soon as they finish their work, they
will be working on the subsequent requests on the same connection.
There
are 720 connections that have been accepted by the server, but only 240
of those have been worked upon. The remaining 480 will never get a
chance, because there are subsequent requests on the same connection to
be worked upon.