apache server usage

Discussion in 'Apache' started by mypoint, Aug 7, 2008.

  1. #1
    Hi, for some reason my cpu usage is 100% and load average is in the 300's and when i look at what is taking up all the cpu it is apache(httpd) and there are alot of them when i do the top command

    how can i fix this? whats going on?

    let me know thanks!
     
    mypoint, Aug 7, 2008 IP
  2. pr0t0n

    pr0t0n Well-Known Member

    Messages:
    243
    Likes Received:
    10
    Best Answers:
    10
    Trophy Points:
    128
    #2
    You need to check what is consuming all those apache processes. Try enabling server-status in your httpd.conf (if it's not enabled already) and then check your apache process list on http://server.hostname/server-status

    Also... you may want to take a look at netstat -nat through your ssh (while logged in as root) and check if there is maybe some ip address that is flooding your server with connections to port 80 . If it's only 1 ip address then you can easily block it and that's it.
     
    pr0t0n, Aug 7, 2008 IP
  3. buldozerceto

    buldozerceto Active Member

    Messages:
    1,137
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    88
    #3
    if it's really someone flooding you with ssh execute this code:
    iptables -I INPUT -p tcp --dport 80 -s 10.1.1.1 -j DROP

    Replace 10.1.1.1 with the IP address that is flooding your server
     
    buldozerceto, Aug 8, 2008 IP