I have an apache prefork module http server running on linux machine. The machine has 8GB RAM. I have following in my /etc/httpd/conf/httpd.conf:

<IfModule prefork.c>
    StartServers       8
    MinSpareServers    5
    MaxSpareServers   20
    ServerLimit      512
    MaxClients       512
    MaxRequestsPerChild  4000

The problem is that no more child processes are getting forked after 256 and the requests are getting queued. I can see the number of child processes stuck at 256 under heavy load.

The average memory of a httpd process is aboout 3.69 MB.


In addition to increasing the MaxClients and ServerLimit settings to 512 you also need to raise MaxRequestWorkers to 512.

Quoted from the fine manual:

... Sites which need to serve more than 256 simultaneous requests may need to increase MaxRequestWorkers ...

And a little bit further:

MaxRequestWorkers Directive

Description: Maximum number of connections that will be processed simultaneously
Syntax: MaxRequestWorkers number

TheMaxRequestWorkers directive sets the limit on the number of simultaneous requests that will be served. Any connection attempts over the MaxRequestWorkers limit will normally be queued
For non-threaded servers (i.e., prefork), MaxRequestWorkers translates into the maximum number of child processes that will be launched to serve requests. The default value is 256; to increase it, you must also raise ServerLimit.

  • Tried increasing MaxRequestWorkers. Didn't work for me. Process count is still stuck at 256. – Rahul Sharma Jun 1 at 7:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.