CPU Load high on server

Discussion in 'Site & Server Administration' started by matik, Jan 5, 2010.

  1. #1
    Hey,

    I didnt touch my sites for a over a month, nor my server, but for the past 2 days my site has been running slow, I checked and my CPU Loads are very high (12+)



    top - 14:32:00 up 47 min, 1 user, load average: 11.45, 12.03, 12.04
    Tasks: 173 total, 17 running, 156 sleeping, 0 stopped, 0 zombie
    Cpu(s): 89.1%us, 10.2%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.7%si, 0.0%st
    Mem: 2067432k total, 1156316k used, 911116k free, 23660k buffers
    Swap: 4096564k total, 0k used, 4096564k free, 867144k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    1322 apache 16 0 37484 22m 3416 S 26.2 1.1 0:14.80 httpd
    2390 apache 16 0 36556 21m 3352 R 15.2 1.0 0:07.25 httpd
    1306 apache 15 0 35340 20m 3404 S 12.6 1.0 0:13.68 httpd
    1323 apache 15 0 33480 18m 3416 R 12.3 0.9 0:13.71 httpd
    811 apache 15 0 34552 19m 3396 S 11.3 1.0 0:18.63 httpd
    31263 apache 16 0 38272 23m 3428 R 10.6 1.1 0:31.19 httpd
    1964 apache 15 0 31344 16m 3416 S 8.9 0.8 0:08.47 httpd
    3354 apache 15 0 29496 14m 3288 S 8.9 0.7 0:00.27 httpd
    3087 apache 15 0 29768 14m 3408 S 8.6 0.7 0:02.63 httpd
    637 apache 16 0 31332 16m 3404 S 8.3 0.8 0:19.00 httpd
    32281 apache 15 0 35576 20m 3416 S 8.3 1.0 0:25.13 httpd
    32719 apache 15 0 33300 18m 3408 S 8.3 0.9 0:24.16 httpd
    2846 apache 15 0 30216 15m 3388 S 7.6 0.8 0:04.06 httpd
    827 apache 15 0 31600 16m 3420 S 7.3 0.8 0:15.70 httpd
    1132 apache 15 0 31496 16m 3416 S 6.3 0.8 0:15.69 httpd
    1884 apache 15 0 29696 14m 3396 S 6.3 0.7 0:08.52 httpd
    3355 apache 15 0 30156 15m 3388 S 6.3 0.8 0:00.19 httpd


    Does someone have any idea on what is causing this CPU Load to be very high?

    My technician is not around, so I need help.

    Thanks.
     
    matik, Jan 5, 2010 IP
  2. hostwebdata

    hostwebdata Peon

    Messages:
    264
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    are u running any high load sprit or mysql database or any think like that ?
     
    hostwebdata, Jan 5, 2010 IP
  3. matik

    matik Peon

    Messages:
    3,471
    Likes Received:
    169
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yea I got a large mysql database, but the above shows that the cpu load is caused by the apache?
     
    matik, Jan 5, 2010 IP
  4. hostwebdata

    hostwebdata Peon

    Messages:
    264
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    are u suing a script to read the database ? that might be your problem with apachey
     
    hostwebdata, Jan 5, 2010 IP
  5. matik

    matik Peon

    Messages:
    3,471
    Likes Received:
    169
    Best Answers:
    0
    Trophy Points:
    0
    #5
    How can I see what inside apache is causing the problem?
     
    matik, Jan 5, 2010 IP
  6. wanderinglex47

    wanderinglex47 Active Member

    Messages:
    275
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #6
    I think it is either a DDoS attack or a lot of traffic is coming from a big site like Digg (check your stats).

    It can also be a problem with Apache which I had about a year ago, it would start httpd processes and not kill them. The only solution I found is restarting Apache at a fixed interval of 15-20 minutes, until I re-installed the whole OS.

    If you have root access, try restarting Apache (service httpd restart) and see if the httpd processes in top start to pile up again...
     
    wanderinglex47, Jan 5, 2010 IP
  7. matik

    matik Peon

    Messages:
    3,471
    Likes Received:
    169
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I restarted the server and rebooted the httpd several times, still the load goes back up to 12+.

    How can I see what inside apache is causing the load to be high?
     
    matik, Jan 5, 2010 IP
  8. wanderinglex47

    wanderinglex47 Active Member

    Messages:
    275
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #8
    Try to check whether it's a incoming traffic problem by running -> watch "netstat -anpt|grep httpd|grep ESTABLISHED" <- via SSH, this will allow you to see all currently connected IP's to your server in real time (provided you have watch and netstat installed). Or you could drop the watch and "" and it'll give you a static list.

    Tell me what you see (or better send a screenshot). I really hope it's because of traffic...
     
    wanderinglex47, Jan 5, 2010 IP
  9. tamer1009

    tamer1009 Peon

    Messages:
    74
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    remove apache and install lighttpd.
     
    tamer1009, Jan 7, 2010 IP
  10. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #10
    Does the server have cPanel installed on it?
     
    RHS-Chris, Jan 7, 2010 IP
  11. systemsupportadmin

    systemsupportadmin Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    you must install httpd+Nginx or as saw tamer1009 you must remove apache and install lighttpd
     
    systemsupportadmin, Jan 7, 2010 IP