I'm trying to set properly an apache installation on an aws instance EC2 m3 Large (with 7.5 Gio or RAM).

Once or twice a week, apache crash with the message: [Thu Aug 14 12:38:33.552250 2014] [mpm_prefork:error] [pid 6279] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting

My question is, how should I set my httpd.conf ?

For now, I always have at least 4.5 Gio RAM free.

I would like to use my hardware the best I can and to prevent apache to chrash suddenly.

Here are my apache settings:

<IfModule mpm_prefork_module>
    StartServers              20
    MinSpareServers           15
    MaxSpareServers           30
    MaxRequestWorkers         80
    MaxConnectionsPerChild  1000

KeepAlive On
KeepAliveTimeout 2
MaxKeepAliveRequests 100

My request are average 25Mb and I allow php to do post for 125 Mb

Is there someone who can advise me?

Many thanks.


2 Answers 2


I am copying some sentences from http://httpd.apache.org/docs/current/misc/perf-tuning.html :

The single biggest hardware issue affecting webserver performance is RAM. A webserver should never ever have to swap, as swapping increases the latency of each request beyond a point that users consider "fast enough". This causes users to hit stop and reload, further increasing the load. You can, and should, control the MaxRequestWorkers setting so that your server does not spawn so many children it starts swapping. This procedure for doing this is simple: determine the size of your average Apache process, by looking at your process list via a tool such as top, and divide this into your total available memory, leaving some room for other processes.


Unless you're running out of memory (it sounds like you are not) then you should do exactly what it says: raise the MaxRequestWorkers setting.

If you were running out of memory, you would need to begin scaling up or out, by increasing the instance size, or adding more instances.

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.