Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Greetings,

I run LAMP on an Ubuntu 8.04 server. I recently completed a "sudo apt-get upgrade" and upgraded all components found.

After this, my Apache frequently uses way too much cpu which in turn causes the website its running to become inaccessible. Before the upgrade it never exceeded around 2-3%.

Doing a "sudo /etc/init.d/apache2 restart" does not restart Apache, it has to be killed using "killall apache".

I am running

PHP 5.2.4-2ubuntu5.7 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug 21 2009 19:52:39)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

Server version: Apache/2.2.8 (Ubuntu)
Server built:   Aug 18 2009 14:18:10

Here is a screenshot taken of "htop": http://bayimg.com/image/hadoeaack.jpg

And here is one of "munin": bayimg.com/image/hadobaack.jpg

I would be eternally grateful for any help as I am loosing users by the minute! Thank you!

Edit: Maybe there is some correlation here:

1144 [Wed Sep 02 03:29:11 2009] [error] server reached MaxClients setting, consider raising the MaxClients setting
1145 [Wed Sep 02 10:07:48 2009] [notice] caught SIGTERM, shutting down
1146 [Wed Sep 02 10:08:22 2009] [notice] Apache/2.2.8 (Ubuntu) mod_ssl/2.2.8 OpenSSL/0.9.8g configured -- resuming normal operations

-------------------

1162 [Wed Sep 02 16:10:14 2009] [error] server reached MaxClients setting, consider raising the MaxClients setting
1163 [Wed Sep 02 19:03:53 2009] [notice] caught SIGWINCH, shutting down gracefully
1164 [Wed Sep 02 19:04:13 2009] [notice] Apache/2.2.8 (Ubuntu) mod_ssl/2.2.8 OpenSSL/0.9.8g configured -- resuming normal operations
1165 [Wed Sep 02 19:05:52 2009] [error] server reached MaxClients setting, consider raising the MaxClients setting

But reaching MaxClients should not cause Apache to crash...? Surely?

share|improve this question
    
You should read this httpd.apache.org/docs/2.0/mod/prefork.html –  Karolis T. Sep 3 '09 at 5:45
    
Also, can you post the output of "free -m"? –  Karolis T. Sep 3 '09 at 5:45
    
Reading "free -m": total used free shared buffers cached Mem: 2017 1865 152 0 121 1520 -/+ buffers/cache: 222 1794 Swap: 5906 0 5906 –  Karl Sep 3 '09 at 5:51
    
"free -m": bayimg.com/image/ladogaack.jpg –  Karl Sep 3 '09 at 5:53
    
munin memory log: bayimg.com/image/madocaack.jpg –  Karl Sep 3 '09 at 6:01

1 Answer 1

I ended up solving it this way:

sudo dpkg --get-selections | grep apache
sudo dpkg --get-selections | grep php

to find all of the apache/php packages, and then

sudo apt-get remove --purge apache2 apache2-mpm-worker apache2-threaded-dev apache2-utils apache2.2-common libapache2-mod-python libapache2-mod-python-doc libapache2-mod-wsgi

to completely remove them.

Then reinstalled the same packages using

sudo apt-get install apache2 apache2-mpm-worker apache2-threaded-dev apache2-utils apache2.2-common libapache2-mod-python libapache2-mod-python-doc libapache2-mod-wsgi

This gives you a completely fresh install of Apache and PHP.

Thanks to http://dancingpenguinsoflight.com/2009/02/how-to-completely-reset-an-apache-instance-in-ubuntu/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.