Apache MaxClients

Discussion in 'Apache' started by digitalpoint, Oct 5, 2009.

  1. #1
    Is there a way to find out what options Apache was compiled with? Or more specifically, I really just want to know how many concurrent clients my web server can support. By default Apache supports up to 256 concurrent clients and requires a recompile to adjust the HARD_SERVER_LIMIT in httpd.h, and just want to find out if this particular compiled version supports more than 256 or not. Anyone?
     
    digitalpoint, Oct 5, 2009 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    Well nevermind. Found the answer myself... HARD_SERVER_LIMIT and recompiling is only necessary for Apache 1.x. Apache 2.x (which I'm using) has a ServerLimit of 20000 compiled into it, so you can just do this to up it to 1,000:
            ServerLimit        1000
            MaxClients         1000
    Code (markup):
     
    digitalpoint, Oct 5, 2009 IP
  3. aramex

    aramex Active Member

    Messages:
    243
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    if you upgrade apache to last verison then no need change maxclient value
     
    aramex, Oct 30, 2009 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    Why, did they remove the option to set it?
     
    digitalpoint, Oct 30, 2009 IP
  5. encep

    encep Peon

    Messages:
    37
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Please use MPM module for apace, you can choose the best fit for you (prefork or worker MPM).

    You need to find what is the MPM you use on server by use this command on SSH:

    httpd -l
    Code (markup):
    You can look at the output the type of your MPM module.

    After that yo could modify apache file config (httpd.conf) file. You can find itu by typing on SSH:

    locate httpd.conf
    Code (markup):
    And edit it use your favorite editor, like vi or nano.

    Add this configuration:

    For Prefork
    <IfModule prefork.c>
    StartServer 50
    MinSpareServer 50
    MaxSpareServer 200
    MaxClients 2000
    MaxRequestsPerChild 1
    </IfModule>
    Code (markup):
    For Worker
    <IfModule worker.c>
    StartServers 2
    MaxClients 150
    MinSpareThreads 25
    MaxSpareThreads 75
    ThreadsPerChild 25
    MaxRequestsPerChild 0
    </IfModule>
    Code (markup):
    For further information about Configuring Apache for Max Performance plese go to http://www.howtoforge.com/configuring_apache_for_maximum_performance

    Best regards,
     
    encep, Nov 1, 2009 IP