0

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
</IfModule>

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.

1

1 Answer 1

2

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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .