LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   HTTPD very high cpu load (https://www.linuxquestions.org/questions/linux-newbie-8/httpd-very-high-cpu-load-4175421042/)

amr_salah944 08-08-2012 12:05 PM

HTTPD very high cpu load
 
Hello guys ,
I've a serious problem :(
HTTPD on my Centos 5.8 machine is eating cpu , here you are the output of top command :


Quote:

Tasks: 141 total, 4 running, 132 sleeping, 5 stopped, 0 zombie
Cpu(s): 70.2%us, 6.9%sy, 0.0%ni, 22.0%id, 0.3%wa, 0.2%hi, 0.3%si, 0.0%st
Mem: 3072584k total, 2095880k used, 976704k free, 413244k buffers
Swap: 2096472k total, 0k used, 2096472k free, 1002636k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
10513 apache 16 0 65072 24m 5852 S 48.8 0.8 0:07.84 httpd
10506 apache 15 0 65352 24m 5284 S 44.5 0.8 0:07.88 httpd
10518 apache 15 0 65072 24m 5280 S 26.0 0.8 0:03.84 httpd
10511 apache 15 0 67392 27m 5892 S 15.2 0.9 0:08.85 httpd
10510 apache 16 0 71300 30m 5280 R 12.5 1.0 0:04.77 httpd
10232 mysql 15 0 844m 257m 5644 S 4.3 8.6 0:56.30 mysqld
10512 apache 16 0 70308 31m 7212 R 3.6 1.0 0:05.83 httpd
10509 apache 15 0 66376 25m 5280 S 0.7 0.9 0:07.43 httpd
1 root 15 0 2160 652 564 S 0.0 0.0 0:00.54 init

after some simple troubleshooting steps I found that after removing this file " /etc/php.d/dom.ini " and restarting httpd it runs better but my site goes down :(

I can't perform more advanced troubleshooting so please guide me .

Thanks in advance .

lithos 08-08-2012 12:38 PM

Hi,

Depends on how much your memory you have in server
then you can try optimize apache
with how many "worker threads" are allowed to run httpd service so you can spread the workload on many instances of httpd (I see you have only 7 listed in your top output)
which on my server is around 20 (with 4GB RAM).
If you have a "heavy" application working on your server (many connections, maybe PHP/MySQL CMS systems (joomla) then it's a hard nut to "crack" to get optimized.
It also depends how many CPU cores you have available (servers often have Xeon CPU's with 4 cores or more and 8 GB RAM and more)

amr_salah944 08-08-2012 12:58 PM

Hello lithos
Thanks for your reply , actually there is no high traffic hitting my server , and there is only one website "cms" and it's eating cpu mooooooore than expected ,I think there is a serious problem whatever I optimized .


All times are GMT -5. The time now is 12:22 AM.