Apache starts lots of processes that keep alive and do not die

Discussion in 'Apache' started by traveller_11, Jun 6, 2011.

  1. #1
    Hi,

    I have some problems with my apache server: It starts lots of processes that seem to keep alive indefinitely. If I do:

    ps aux | grep apache

    I get something like below. The list increases until a huge number of processes, then apache dies with a "maximum number of clients exceeded" error.

    I'm also using a virtual host for a 301 redirect of a second domain:

    <VirtualHost *:80>
    ServerName second.com
    DocumentRoot /var/www/redirect2

    </VirtualHost>

    (In /var/www/redirect2 there is a .htaccess file doing the redirect)


    I'm lost with this. Any idea, where these flood of processes could come from?

    Thanks a lot!

    apache 11679 0.6 0.6 361336 6748 ? S 14:19 0:03 httpd -k start
    apache 21822 0.2 0.6 360820 6532 ? S 14:25 0:00 httpd -k start
    apache 21824 0.5 0.6 361332 6556 ? S 14:25 0:00 httpd -k start
    apache 22494 0.3 1.0 364128 10384 ? D 13:19 0:14 httpd -k start
    apache 22497 2.4 1.4 368300 14488 ? R 13:19 1:40 httpd -k start
    apache 22498 0.1 0.6 361324 6636 ? S 13:19 0:05 httpd -k start
    apache 22499 0.5 0.9 363184 9404 ? S 13:19 0:22 httpd -k start
    apache 22500 0.7 0.8 362836 9120 ? R 13:19 0:29 httpd -k start
    apache 22501 0.3 0.6 361324 6808 ? R 13:20 0:13 httpd -k start
    apache 22502 0.6 0.7 360812 7324 ? S 13:20 0:28 httpd -k start
    apache 22503 0.6 0.7 361324 7216 ? R 13:20 0:25 httpd -k start
    apache 22505 1.2 0.7 361324 7212 ? R 13:20 0:48 httpd -k start
    apache 22506 0.8 0.6 360812 6828 ? R 13:20 0:33 httpd -k start
    apache 22507 0.8 0.6 361324 7080 ? S 13:20 0:36 httpd -k start
    apache 22508 0.4 0.6 361328 7092 ? R 13:20 0:18 httpd -k start
    apache 22510 0.6 0.6 361324 7072 ? S 13:20 0:27 httpd -k start
    apache 22512 4.5 0.8 362144 8624 ? S 13:20 3:07 httpd -k start
    apache 22514 0.5 0.6 361324 7024 ? S 13:20 0:20 httpd -k start
    apache 22517 3.4 4.0 394996 40996 ? S 13:20 2:19 httpd -k start
    apache 22518 0.3 0.6 361324 7128 ? S 13:20 0:15 httpd -k start
    apache 23488 10.4 0.6 360820 6864 ? S 14:26 0:06 httpd -k start
    apache 23495 4.1 0.6 360820 6540 ? S 14:27 0:01 httpd -k start
    apache 23496 3.5 0.6 360820 6524 ? S 14:27 0:01 httpd -k start
    apache 23497 2.0 0.6 360820 6536 ? S 14:27 0:00 httpd -k start
    apache 23499 4.0 0.6 360820 6516 ? S 14:27 0:01 httpd -k start
    apache 23501 21.7 0.6 360820 6516 ? S 14:27 0:06 httpd -k start
    root 23507 1.7 0.0 103144 840 pts/0 S+ 14:27 0:00 grep apache
    apache 23508 38.3 0.6 360820 6432 ? S 14:27 0:07 httpd -k start
    apache 23512 14.1 0.6 360820 6520 ? S 14:27 0:00 httpd -k start
    apache 23516 87.0 0.6 360820 6532 ? S 14:28 0:00 httpd -k start
    apache 23520 0.0 0.6 360820 6516 ? S 14:28 0:01 httpd -k start
    apache 23521 0.0 0.6 360820 6516 ? S 14:28 0:01 httpd -k start
    apache 24980 0.5 0.6 361324 7016 ? S 13:29 0:18 httpd -k start
    apache 25406 0.1 0.6 361332 6800 ? S 13:30 0:03 httpd -k start
     
    traveller_11, Jun 6, 2011 IP
  2. stach14

    stach14 Peon

    Messages:
    178
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Review your error logs, see if your getting botted. Also, inspect your /tmp directory to see if there are any malicious programs running. This is why we recommend managed hosting, so you can leave the server to the pros and focus on getting traffic and your web site.
     
    stach14, Jun 6, 2011 IP
  3. stardust.x7

    stardust.x7 Active Member

    Messages:
    369
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    90
    #3
    Limit your apache process first.

    Edit :

    And add this line on that blank file :

    * Change the first number to the new process limit, then add 5 to get the second number.
     
    stardust.x7, Jun 7, 2011 IP