Help needed to Apache Newbie too many procceses

Discussion in 'Apache' started by zero477, Dec 26, 2011.

  1. #1
    Hello all,I am new to the forum and also to Apache.I recently migrated my site from a hosting to a Virtual Private Server. The server has a Cent Os.My site is not working and the guys from support told me that TOO MANY APACHE PROCESSES were running.What do they mean? How can I solve that?My site is simple, I only have a simple .htaccess file with some redirects....I usually manage everything with a Plesk PanelI hope someone can guide me and help...
     
    zero477, Dec 26, 2011 IP
  2. T-N-Media

    T-N-Media Member

    Messages:
    47
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #2
    Check your logs at /var/log/httpd/error_log
    This will give you a hint about what's going wrong.
     
    T-N-Media, Dec 26, 2011 IP
  3. pr0t0n

    pr0t0n Well-Known Member

    Messages:
    243
    Likes Received:
    10
    Best Answers:
    10
    Trophy Points:
    128
    #3
    You do have an ssh & root access to your VPS right? If so, then when it happens again try to shh login to your server and do this:
    
    netstat -nat
    
    Code (markup):
    And look for an specific ip address that could be flooding your apache server. If you do find one ip address with too many processes then try blocking it, and that might fix the problem. Of course check what that ip address is, you probably don't want to block Google bot, or some other search engine. If you find a lot of SYN_RECV requests, then your server might be under SYN Flood attack. Keep in mind that IP's can be spoofed, so don't just block all if there are too many.

    As an additional measures, you can:
    1. enable 'server-status' in your apache config, and monitor it from time to time (unfortunately it will not work when apache crashes or consumes too many processes)
    2. try increasing the number of processes in your apache, but don't set too large limit, as then it may start consuming too much cpu/ram
     
    pr0t0n, Dec 26, 2011 IP
  4. zero477

    zero477 Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #4
    I cant find the error still:

    I migrated form my site from a hosting account to a Virtual Priviate Server.


    Until now, it is not working properly.


    For example: when I make a query with PHP (without the word LIMIT ##) or open an url with an Iframe.


    I can see that the server strats many apache processes. I can see this using the TOP command. Hundreds of Apache Users appear using 1.4% of the memory and the server crashes (so i have to restart it).


    My site is coded exactly as it was on the hosting account.


    I guess there is a way to prevent this things to happen... Imagine that I have a user that makes this kind of urls.. all the time the server will be crashing.
     
    zero477, Dec 27, 2011 IP
  5. pr0t0n

    pr0t0n Well-Known Member

    Messages:
    243
    Likes Received:
    10
    Best Answers:
    10
    Trophy Points:
    128
    #5
    Try my suggestions, and you should beable to catch which script exactly overconsumes your apache usage. To have your server-status turned on, follow this tutorial:
    http://kb.parallels.com/264

    and/or for increasing max apache clients, follow the guide under "Apache Configuration" section on this link:
    http://www.howtogeek.com/wiki/Tweaking_a_Dedicated_Virtual_Web_Server

    In the case your server load does not go too much high when such problems happen then I guess you could try with increasing your apache limites slowly, until you reach some optimal configuration.
     
    pr0t0n, Dec 28, 2011 IP
  6. GMC

    GMC Member

    Messages:
    99
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    45
    #6
    I have always found the top command useful to see what is actually happening on my servers

    grab a little proggy called putty

    google it

    Then once in - type "top" without the "" and see what it spits up

    It looks like a lot of numbers - but once you learn what it all means - its pretty useful

    GMC
     
    GMC, Dec 28, 2011 IP
  7. pr0t0n

    pr0t0n Well-Known Member

    Messages:
    243
    Likes Received:
    10
    Best Answers:
    10
    Trophy Points:
    128
    #7
    I believe he already said he used top to detect a lot of processes. Anyways, top will not provide him with information what those processes are exactly doing.
     
    pr0t0n, Dec 28, 2011 IP
  8. zero477

    zero477 Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #8
    Hello everyone,

    I do not know why but the problem is solved now. A friend told me to modify these parts of codes of the file httpd.conf and now everything works fine.

    ifmodule worker.c and ifmodule prefork.c

    I raised the number ther (maxclients, MinSpareServers, etc....)


    Thank you all for your answers... Protton! I will check your tutorials
     
    zero477, Dec 28, 2011 IP