I'm currently investigating an issue with some of our servers where Apache processes end up eating a lot of memory to the point of hitting the swap file and causing the server to be unresponsive if peak traffic is hit. Looking at the Apache conf for a particular problem server, I see this in the conf file:

StartServers 50 MinSpareServers 25 MaxSpareServers 90 ServerLimit 185 MaxClients 185 MaxRequestsPerChild 4000

The server in question currently has 185 spare Apache processes running, eating up 6.2GB of 7.2GB available on the server. But shouldn't Apache only have 90 active processes? It seems to be using the ServerLimit instead of MaxSpareServers to determine how many active Apache process are on the machine. I would understand if it were doing this during peak traffic times, but even when there's barely any traffic going to the server, there are always 185 httpd processes running on the server.

Config: Apache 2.2.15 PHP 5.3.3 Redhat Linux Enterprise 6.3

So why are there always 185 Apache processes running when my MaxSpare setting is capped at 90?

  • Did my answer serverfault.com/a/714011/101203 solve your question? If so, I'd appreciate if you upvote and/or mark it as accepted so I get credit and also so people in the future who read this know that it was a solution. Thanks – sa289 Jan 25 '16 at 16:50
  • Your answer helped, but it didn't solve my question. We figured out what it was eventually using by looking at the logs. – Frank Rosario Jan 25 '16 at 18:10

Your configuration as shown shouldn't cause there to be 185. It could be that for some reason you actually have that many requests simultaneously (such as slow HTTP DoS attacks). Check out what mod_status shows you to investigate further (see http://httpd.apache.org/docs/2.2/mod/mod_status.html for how to enable it).

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.