Some apache help please

Discussion in 'Apache' started by -jay-, Mar 2, 2008.

  1. #1
    apache is running at 259 processes . maxed out. a few weeks ago i had server upgraded with profork support, i was told i could have 400 processes now. seems its still maxed at 259. does anyone know ...

    1. how to tell if i can have 400 processes
    2. how to see what processes is killing the server.
     
    -jay-, Mar 2, 2008 IP
  2. Cybernaut

    Cybernaut Peon

    Messages:
    408
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Its "prefork", not "profork". If your server is not taking ages to load a page or giving connection timeout or server busy errors then there is nothing to worry about.

    Type "ps auxf" in shell to CPU and memory usage for all processes or use "top" command for live stats.

    You can check "apache status" page to see if there are too many lingering connections ("SS" value too high).

    You can adjust prefork mpm config options. Set MaxRequestsPerChild to some value like 1000. Adjust Start/Min/MaxSpareServers (raise them if they 5/10).

    Lower the value of KeepAliveTimeout (2 to 3 sec are enough). Make sure HostnameLookups is "Off".
     
    Cybernaut, Mar 2, 2008 IP
  3. -jay-

    -jay- Well-Known Member

    Messages:
    2,311
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    160
    #3
    thanks. sent you a pm.
     
    -jay-, Mar 2, 2008 IP
  4. bleeber

    bleeber Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can also try the following.

    grep MaxClients /etc/httpd/conf/httpd.conf (or your location)
    Code (markup):
    This will let you know what apaches limit is set to.

    After you have that information, see who is using up all your connections.

    netstat -np | grep ":80" | awk '{ print $5 }' | awk -F ":" '{ print $1 }' | sort | uniq -c | sort -n
    Code (markup):
    This will list the number of connections from each IP. If you notice that someone is perhaps running an application dos vs you then.

    iptables -A INPUT -s their.ip.here -j DROP
    Code (markup):
    Then restart apache.

    /etc/init.d/httpd restart
    Code (markup):
     
    bleeber, Mar 3, 2008 IP
  5. -jay-

    -jay- Well-Known Member

    Messages:
    2,311
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    160
    #5
    thank you. this was the absolute best info someone has ever given me to a question. this was the problem.
     
    -jay-, Mar 3, 2008 IP
  6. -jay-

    -jay- Well-Known Member

    Messages:
    2,311
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    160
    #6
    one more thing. is there a way to limit the amount of connections 1 ip address can use. I had 1 using 192 connections. I want to limit to 10.
     
    -jay-, Mar 3, 2008 IP
  7. babarhyd

    babarhyd Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    You need mod_evasive and mod_security! which limits each ip to 30 connections I assume.
     
    babarhyd, Mar 3, 2008 IP
  8. bleeber

    bleeber Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    mod_limitipconn
     
    bleeber, Mar 3, 2008 IP
  9. bleeber

    bleeber Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thanks for the compliment. I missed it the first time. I have been admin'ing servers for over 10 years now and I knew from the sound of your question what the problem likely was. I see it all the time now a days. If you are running a shared environment, there is also a way to tell which domain is the target as well.
     
    bleeber, Mar 3, 2008 IP
  10. -jay-

    -jay- Well-Known Member

    Messages:
    2,311
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    160
    #10
    is that mod_limitipconn hard to install ?

    im on a dedicated server but i know which domain is being hit. i stopped it and all is good now. again thank you.
     
    -jay-, Mar 3, 2008 IP
  11. bleeber

    bleeber Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Here is an article on installing it.

    http://www.fluffyducky.com/pages/60/page1/Installing-mod-limitipconn/
     
    bleeber, Mar 3, 2008 IP
  12. -jay-

    -jay- Well-Known Member

    Messages:
    2,311
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    160
    #12
    looking for someone to install this mod-limitipconn for me. please pm me price to install it. must be a trusted member.
    thanks.
     
    -jay-, Mar 5, 2008 IP
  13. -jay-

    -jay- Well-Known Member

    Messages:
    2,311
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    160
    #13
    mod-limitipconn worked for a while. it doesnt seem to be working anymore. can someone help me fix this and get it working again.

    paying 10$ via paypal or epass .
     
    -jay-, Nov 2, 2008 IP
  14. -jay-

    -jay- Well-Known Member

    Messages:
    2,311
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    160
    #14
    theres no one good at apache in here that can help me ?
    what if i upped it to 20$
     
    -jay-, Nov 2, 2008 IP
  15. supportmatrix

    supportmatrix Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    We can help you in this.
     
    supportmatrix, Nov 3, 2008 IP