Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache MaxClients when KeepAlive is Off

with apache, is it reasonable to reduce MaxClients when KeepAlive is Off? currently, MaxClients is set to 150, which is the default for mpm-worker.

  • nginx serves static files and reverse-proxies to apache
  • we are averaging around 12-15 requests per second
  • cpu load avg is never above 0.8 on a quad-core box

thanks!

like image 781
Carson Avatar asked Jun 30 '26 18:06

Carson


1 Answers

Not allowing keep alive connections does mean that one could technically drop MaxClients. This is because request handler threads in Apache will not be tied up waiting to see if there will be a subsequent request on same connection. Thus, you would get better utilisation of available request handler threads and so may not need as many.

Also worth knowing is that if all traffic is coming via nginx, is that nginx only implements HTTP/1.0 in its proxy module and also doesn't implement keep alive requests over the proxied connection. Thus, using keep alive on the Apache side is pointless when using nginx in front of it. Because though nginx doesn't implement keep alive, it should drop the connections promptly as it will have no intention of reusing them, so you shouldn't suffer if you do forget to turn of keep alive in Apache when using nginx as front end.

That nginx proxy only supports HTTP/1.0 and does not use keep alive is mentioned in its proxy documentation:

http://wiki.nginx.org/NginxHttpProxyModule

like image 180
Graham Dumpleton Avatar answered Jul 03 '26 16:07

Graham Dumpleton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!