I am running an apache 2 webserver. Everything works fine, but about every 14-20 days i have to restart the web server because it does not respond anymore.

Looking at the munin statistics, i recognized, that it is related to the number of apache processes. They are increasing continuously until they reach 150. Then Apache does not respond.

How do i prevent "freezing" apache?

Here is screenshot of the statistics:

increasing processes in an apache 2 web server


  • Apache runs on a Debian 5.0 root server.
  • Using ISPConfig for management
  • I host about 30 Websites
  • 1000 Page Impressions per day (sum of all websites)
  • Most of them are Drupal installations
  • One Piwik Installation for all sites
  • Some custom PHP applications

Logs ans Status messages:

Extended apache status shows 30 of 45 of these lines (replaced real hostname by SERVERNAME):

22-5    -   0/0/75  .   0.00    1813    0   0.0 0.00    1.17    ::1 SERVERNAME  OPTIONS * HTTP/1.0

Some Apache Settings (Default settings):

  • prefork module is enabled
  • MaxKeepAliveRequests = 100
  • Timeout = 300
  • KeepAlive = On
  • KeepAliveTimeout = 15
  • MaxClients = 150
  • MaxRequestsPerChild = 0
  • StartServers = 5
  • MinSpareServers = 5
  • MaxSpareServers = 10
  • MaxClients =150
  • MaxRequestsPerChild = 0
  • Which application you run on Apache? What does httpd.conf look like? Did you take a look at extended status page?
    – quanta
    Sep 5, 2011 at 8:52

2 Answers 2


This looks like you have some requests that never terminate, forcing Apache to spawn new processes until the configured maximum is reached. After that, Apache has no option to create new processes for new requests and appears dead.

It's impossible to tell what might cause this with the few data you give us.

Do you see any hints in the log files? What kind of pages to you serve to the clients? Static HTML, PHP, CGI or something else? On what OS?

  • I added some details. What should i look for in the log files? Sep 5, 2011 at 8:52

You should certainly not be seeing this kind of behaviour - it implies something is very broken in your system.

What are your settings for:



Is this pre-fork or threaded apache?

However it's much more likely that the problems are arising elsewhere. Does apache use any scripting/app engine? If so what? How is it configured?

  • i updated my question Sep 5, 2011 at 18:32
  • Your config is far from optimal - try StartServers 20, MinSpareServers 15, KeepAliveTimout 3, MaxRequestsPerChild 250 (this last value is deliberately on the low side given your current problems). MaxClients looks to be a little low if this is a dedicated machine - but the right value depends on memory usage. But as above, it sounds like the problems are in the PHP code - is this mod_php, fastCGI, CGI? Any ignore_user_abort() in your code?
    – symcbean
    Sep 6, 2011 at 8:59
  • Mostly Fast-CGI, some CGI and one SuPHP. some ignore_user_abort() in cron files. Sep 7, 2011 at 16:21

You must log in to answer this question.

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