0

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

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.

Jaycreation
  • 111
  • 3
  • 1
    possible duplicate of [How do you do load testing and capacity planning for web sites?](http://serverfault.com/questions/350454/how-do-you-do-load-testing-and-capacity-planning-for-web-sites) – Jenny D Aug 19 '14 at 07:30

2 Answers2

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.

StanleyD
  • 151
  • 4
1

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.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940