Apache server completely freezes until it gets restarted
Posted
by nbv4
on Server Fault
See other posts from Server Fault
or by nbv4
Published on 2010-04-21T17:03:38Z
Indexed on
2010/04/21
17:13 UTC
Read the original article
Hit count: 319
My server does this every few days. What sucks is that it always seems to do this right after I go to bed, so when I wake up, I'm greeted with the fact that my server has been down for the past 6 or 7 hours.
When I first noticed this, I added a cronjob that tries to restart the server every 15 minutes, but I guess that didn't fix it. Once I noticed the server was down, I can this command:
/etc/init.d/apache2 restart
* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
... waiting ...........................................................apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
httpd (pid 17597) already running
...which is odd, because a restart should restart the server, even if it's already running, correct? I eventually had to "stop" then "start" to get it working again.
I then looked through the logs, and found something very weird. It seems that around the time the server crashed, the logs have entries that are wildly out of order. It looks a little like this:
xx.xxx.xxx.x - - [21/Apr/2010:06:32:05 -0400] "GET / blah"
xx.xxx.xxx.x - - [21/Apr/2010:06:51:25 -0400] "GET / blah"
x.xx.xxx.xxx - - [21/Apr/2010:06:38:23 -0400] "GET / blah"
xxx.xx.xx.xx - - [21/Apr/2010:06:31:56 -0400] "GET / blah"
xxx.xx.xx.xx - - [21/Apr/2010:06:51:49 -0400] "GET / blah"
xx.xx.xxx.xx - - [21/Apr/2010:06:33:20 -0400] "GET / blah"
I don't think the problem is memory, because this:
tells me that right before the crash, memory usage is fine.
I'm running apache with the worker mpm, here are the settings for that:
<IfModule mpm_worker_module>
StartServers 1
MaxClients 100
MinSpareThreads 5
MaxSpareThreads 10
ThreadsPerChild 10
MaxRequestsPerChild 3000
</IfModule>
This apache server is running a bunch of stuff, but most of the traffic comes from a django project I'm hosting, that uses mod_wsgi. There also is a simple machines forum that is running off of mod_fcgid. Those setting are below:
<IfModule mod_fcgid.c>
MaxRequestsPerProcess 500
MaxProcessCount 3
AddHandler fcgid-script .php .fcgi
AddHandler cgi-script .cgi .pl
FCGIWrapper "/usr/bin/php-cgi" .php
</IfModule>
Anyone know of anything else I can check? I've just about tweaked every single setting I can think of, yet these freezes still happen.
© Server Fault or respective owner