Portal Home > Knowledgebase > Articles Database > Suddenly Apache uses a lot of CPU


Suddenly Apache uses a lot of CPU




Posted by Fernando Marcelo, 10-27-2009, 11:29 AM
Hello, I have moved my 2 websites to a new server running Debian ( it was runnning CentOs with Cpanel ). Both of them are high load websites. When i start apache, everything runs fine ( about 200 requests/sec ). Suddenly, after 30 or 60 minutes running, apache starts using a lot of CPU and server load goes to 200 or higher. So i have to reboot the server. Do you have any idea of what could cause this problem? I mean, the scripts are the same, they are well optimized. So i am not sure what could cause this problem. Any ideas? Is there any additional info that i should provide? Thank you!

Posted by Shain P, 10-27-2009, 11:56 AM
Please provide the output of the following command ===================== ps aux | grep apache =====================

Posted by Fernando Marcelo, 10-27-2009, 11:58 AM
Thanks for your answer. I get this when i run ps:

Posted by Fernando Marcelo, 10-27-2009, 12:55 PM
I have fixed the problem by removing the uploadprogress.so php extension. Does anyone had this problem before? The issue is that i need this extension loaded, because of one of my websites. Any ideas?

Posted by Shain P, 10-27-2009, 01:17 PM
I am not aware of any cases where uploadprogress.so could cause this. If the issues are due to a large number of connections to Apache, This command could list the number of connections from each IP. ============================================================================ netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1 ============================================================================

Posted by TowerOfPower, 10-27-2009, 01:24 PM
Every Apache module is going to contribute to the amount of memory used by each Apache child process. That memory footprint will also tend to grow with time, as modules cache data and leak data. Some modules are worse than others in this regard. What you need to do is either look into the configuration setting of your problem modules to see if you can limit them in some way, and/or play around with the Apache MPM settings to limit the amount of spawned children. You can also have Apache recycle each child process after a given number of requests happen, which will help elevate some of the memory problems associated.

Posted by keserhosting, 10-28-2009, 10:23 AM
I think you should need to recompile the apache again.

Posted by ramsh, 10-28-2009, 11:01 AM
It seems a DDOS attack in your server . You need check the number connection from each IP , if any IPs are using large connection , then block such IPs. You can check the number connection from each IP using the code . You can block such IPs using the command Regards, Ramsh



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
XML/xQuery vs MySQL (Views: 474)
bind not configured? (Views: 452)
ip ping Need Help (Views: 471)
dns for reseller (Views: 458)