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.

How to increase HARD_SERVER_LIMIT ?

Discussion in 'General Discussion' started by secretman, Nov 5, 2006.

  1. secretman

    secretman Member

    Joined:
    Jul 23, 2003
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Hello,
    I have need to increase HARD_SERVER_LIMIT on apache.

    I have set MaxClients 20000 on httpd.conf but when I start apache show
    this error :

    WARNING: MaxClients of 20000 exceeds compile time limit of 2048 servers,
    lowering MaxClients to 2048. To increase, please see the
    HARD_SERVER_LIMIT define in src/include/httpd.h.

    How to increase?
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    You'll have to build as normal then go into either:

    /home/cpapachebuild/

    or

    /home/cpeasyapache/

    depending on your cPanel version and wade into that tree and make your modification and then run the buildscript.
     
  3. secretman

    secretman Member

    Joined:
    Jul 23, 2003
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    /home/cpapachebuild/ is a directory. I don't know how to increase HARD_SERVER_LIMIT.
     
  4. rviradia

    rviradia Well-Known Member

    Joined:
    Jul 25, 2005
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    pico /home/cpins/installd/buildapache/apache_1.3.33/src/include/httpd.h

    update HARD_SERVER_LIMIT in this file

     
  5. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    should be something like this:
    /home/cpapachebuild/buildapache/apache_<VERSION_NUMBER>/src/include
    folder. replace the VERSION_NUMBER with you Apache version, IE: 1.3.37 this is where you'll find the httpd.h file

    Mickalo
     
  6. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    The local path to httpd.h file where you can modify HARD_SERVER_LIMIT is:
    /home/cpapachebuild/buildapache/apache_1.3.37/src/include/httpd.h
    You'll see the following directives:
    Code:
    #ifndef HARD_SERVER_LIMIT
    #ifdef WIN32
    #define HARD_SERVER_LIMIT 1024
    #elif defined(NETWARE)
    #define HARD_SERVER_LIMIT 2048
    #else
    #define HARD_SERVER_LIMIT 2048
    #endif
    #endif
    
    My question: Are you sure you need to go up to 20000, although the variable is not there? You would need to have a huge connection and millions and millions of hits a day to go over 256 or a 1000. In any case, you may not need such a high setting for MaxClients, if you turn off KeepAlives. On a high traffic web servers, setting the MaxClients up to 1000 might cause extreme high load on the server. During peak hours you can even DOS attack that server. Good luck!
     
  7. rtgasia

    rtgasia Member

    Joined:
    Sep 30, 2006
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Hi Andy

    We have a server serving files (free file storage sites) with a lot of hits a day, in excess of 100,000.

    We have the Core2Duo 2.2 and 4GB RAM running Apache 1.3.37 on a 100mbps Dedicated Line.

    WHat would you suggest we keep the MaxClients to?
     
  8. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    256, unless you need to go higher than that. If yes, you'll have to re-compile Apache, by hand, with the variable you want.
     
  9. useradmin

    useradmin Well-Known Member

    Joined:
    Oct 8, 2004
    Messages:
    107
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    INDIA
    default limit

    HI,


    timeout
    maxclient and many apache limit revert back to default value
    how to fix this problem.


    for example
    Timeout = 300
    MaxClient = 150
    MaxKeepAliveRequests 100
    MinSpareServers 5
    MaxSpareServers 10


    we would like to use our own value.
     
  10. daelda

    daelda Member

    Joined:
    Feb 3, 2005
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I have the same problem but with version 2.2.6 of apache which is supposed no to has this problem.

    In file /home/cpeasyapache/src/httpd-2.2.6/include/httpd.h there is no HARD_SERVER_LIMIT

    How could i solve it?

    Thank you.
     
  11. daelda

    daelda Member

    Joined:
    Feb 3, 2005
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I have solved it with:

    ServerLimit 1200
    MaxClients 1000

    in httpd.conf

    Thank you,

    Daelda.
     
    #11 daelda, Jan 9, 2008
    Last edited: Jan 9, 2008
  12. nick1

    nick1 Member

    Joined:
    May 21, 2006
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    ServerLimit option doesn't work in Apache 1.3x

    thanks,
     
  13. hicom

    hicom Well-Known Member

    Joined:
    May 23, 2003
    Messages:
    272
    Likes Received:
    0
    Trophy Points:
    16
    I'm just adding this note for anyone looking to resolve this problem in the future.

    You can increase FD_SETSIZE and HARD_SERVER_LIMIT when running EasyApache 3 under Apache Update. It is one of the options when you go to select the different modules to install on the server.

    Hope this will be of help to some people.

    Thanks

    Tamouh
     
Loading...

Share This Page