Need help - Apache processes are way too high

beansbaxter

Verified User
Joined
Mar 17, 2004
Messages
216
Location
WA
I moved a few websites from one dedicated server to a new dedicated server. The new server is much faster than the old one and has much more memory. The old server ran fine, but server load started to get up there, so I wanted to distribute the website traffic to another server.

So the new server was setup (CentOS 5.9 with DA) and ever since moving a handful of the sites to the new server, the server load has been super high, in the 8 to 10 range, and httpd processes swells to 8GB causing Apache to take forever to load the websites.

When I restart the httpd service, the sites all load super fast again, but within minutes, the processes increase to over 8GB in just a matter of minutes, and again the server takes forever to load.

The old server was less powerful, but still capable, and yet never had this issue.

I added a MaxClients setting to the Apache config, set it to 450, and that made no difference. I've never had to add this setting before.

What else could be causing this?

Same sites working fine on one server were moved to this new server and I don't understand why I'm having this issue with Apache.

Any help or guidance to see what's going on or how to resolve this?

Thanks.
 
Enable slow query logging in mysql. How busy are your sites? Have you enabled extended status on apache to check the active connections? Try tweaking mysql config as well.
 
What else could be causing this?

Same sites working fine on one server were moved to this new server and I don't understand why I'm having this issue with Apache.

Any help or guidance to see what's going on or how to resolve this?


Your old servers were probably optimized and were running services with tweaked configs. Did you install default config files on your new server or you are using old ones?

Apache, MySQL, PHP should be optimized on your server. And 450 concurrent users might too high for your server. For diagnosis purposes you might want to install munin, and see it's graphs, they might give a clue.
 
One more vote for MySQL problem.

Login to your MySQL server (mysql -u da_admin -p). Then enter the command:

Code:
SHOW PROCESSLIST;

Do that while the HTTPD processes are too much. I bet you will see one username (database name) which will take many connections. Usually they are in "sleep" state for many seconds (not doing anything, but utilizing from max_connections on MySQL and taking memory).

If that's the case, one website is abusing the server. You are maxing the "max_connections" on MySQL and it refuses to take more. When HTTPD is trying to connect to the database, it has to wait one of the existing connections to timeout. So it waits... and more come and they wait... and your server "hangs".
 
Back
Top