The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

httpd processes maxing out cpu

Discussion in 'General Discussion' started by payne, Dec 15, 2004.

  1. payne

    payne Well-Known Member

    Joined:
    May 31, 2003
    Messages:
    103
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Seattle
    Hello, I have a cpanel rh6 server that started to max out the cpu a couple times a day. When I use 'top' I discover that one or more httpd processes are taking up all available cpu. They will stick around continuously chewing up cpu until I kill them. When I use apache server-status, I find the processes are doing random things... sometimes running a php script but sometimes just requesting some plaintext html page.

    Where do I go from here?
     
  2. linux-image

    linux-image Well-Known Member

    Joined:
    Jun 8, 2004
    Messages:
    1,192
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    Root Administrator
    are you having a dos attack ? what does

    netstat -apn | grep :80

    say ? does it give a big list ?
     
  3. payne

    payne Well-Known Member

    Joined:
    May 31, 2003
    Messages:
    103
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Seattle
    actually, no... it's just a small list:

    tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 9684/httpd
    tcp 0 0 my.ip:80 84.66.33.214:1228 FIN_WAIT2 -
    tcp 0 0 my.ip:80 84.66.33.214:1226 FIN_WAIT2 -
    tcp 0 0 my.ip:80 132.70.50.117:40160 ESTABLISHED 9722/httpd
    tcp 0 0 my.ip:80 62.0.145.162:2320 TIME_WAIT -
    tcp 0 0 my.ip:80 62.0.145.162:2322 TIME_WAIT -
    tcp 0 0 my.ip:80 62.0.145.162:2313 TIME_WAIT -
    tcp 0 0 my.ip:80 62.0.145.162:2315 TIME_WAIT -
    tcp 0 0 my.ip:80 62.0.145.162:2314 TIME_WAIT -
    tcp 0 0 my.ip:80 62.0.145.162:2316 TIME_WAIT -
    tcp 0 0 my.ip:80 62.0.145.162:2319 TIME_WAIT -
    tcp 0 0 my.ip:80 62.0.145.162:2304 TIME_WAIT -
    tcp 0 0 my.ip:80 62.0.145.162:2306 TIME_WAIT -
    tcp 0 0 my.ip:80 62.0.145.162:2308 TIME_WAIT -
    tcp 0 0 my.ip:80 213.186.171.106:3147 ESTABLISHED 11896/httpd
    tcp 0 0 my.ip:80 62.0.145.162:2300 TIME_WAIT -
    tcp 0 0 my.ip:80 62.0.145.162:2302 TIME_WAIT -
    tcp 0 0 my.ip:80 201.254.60.177:59782 ESTABLISHED 9715/httpd
    tcp 0 0 my.ip:80 145.102.0.30:6129 FIN_WAIT2 -
    tcp 0 0 my.ip:80 145.102.0.30:6130 FIN_WAIT2 -
    tcp 0 0 my.ip:80 66.249.64.14:36725 TIME_WAIT -
    tcp 0 0 my.ip:80 131.113.203.125:3343 ESTABLISHED 11672/httpd
    tcp 0 0 my.ip:80 131.113.203.125:3341 TIME_WAIT -
    tcp 0 0 my.ip:80 203.215.76.28:3496 TIME_WAIT -
    tcp 0 0 my.ip:80 213.205.138.158:38439 TIME_WAIT -
    tcp 0 0 my.ip:80 203.215.76.28:3538 TIME_WAIT -
    tcp 0 0 my.ip:80 203.215.76.28:3536 TIME_WAIT -

    But right now, this process is taking over the cpu:
    PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
    11617 nobody 20 0 69208 67M 2972 R 85.2 6.7 22:01 httpd

    Which, according to server-status is a php script. I'll look into the actual script itself, but I know the server was also maxing out on simple html page requests.
     
  4. linux-image

    linux-image Well-Known Member

    Joined:
    Jun 8, 2004
    Messages:
    1,192
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    Root Administrator
    what does

    ipcs

    give ?
     
  5. payne

    payne Well-Known Member

    Joined:
    May 31, 2003
    Messages:
    103
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Seattle
    ------ Shared Memory Segments --------
    key shmid owner perms bytes nattch status
    0x00000000 131072 root 600 368644 47 dest

    ------ Semaphore Arrays --------
    key semid owner perms nsems status
    0x00000000 1310720 nobody 600 1

    ------ Message Queues --------
    key msqid owner perms used-bytes messages
     
  6. payne

    payne Well-Known Member

    Joined:
    May 31, 2003
    Messages:
    103
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Seattle
    Any ideas where else to look? I'm going ahead and reinstalling apache/php now to see if that takes care of things. Earlier today it was completely maxed out on a request for a .jpg.
     
  7. linux-image

    linux-image Well-Known Member

    Joined:
    Jun 8, 2004
    Messages:
    1,192
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    Root Administrator
    do an apache recompilation and see.
     
  8. payne

    payne Well-Known Member

    Joined:
    May 31, 2003
    Messages:
    103
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Seattle
    recompiled from scratch and still have the same problem. Also, I thought about scheduling an httpd restart every hour... but apparently /etc/init.d/httpd restart doesn't clear the bad threads.
     
Loading...

Share This Page