Results 1 to 14 of 14
  1. #1
    Join Date
    Jun 2004
    Posts
    197

    how to change MaxClients on apache2

    Since I upgraded to apache2.2 I dont seem to be able to find the "MaxClients" setting in httpd.conf.

    I spent some time on google and aparently this has been taken out because apache2 is multi-threaded. What I do know is no more than about 250 people can connect to my server.

    Any ideas how to up this limit?

    thanks

  2. #2
    Join Date
    Sep 2002
    Location
    Top Secret
    Posts
    11,687
    MaxClients is handled differently in apache2 than apache. You need to do something like this:
    Code:
    ServerLimit 1500
    MaxClients 1500
    Otherwise, by just setting maxclients, you will get:
    WARNING: MaxClients of 1500 exceeds ServerLimit value of 256 servers,
    lowering MaxClients to 256. To increase, please see the ServerLimit
    directive.
    WHMCS Guru - WHMCS addons, management, support and more.
    WHMCS Notifications Extended - Add slack, hipchat, SMS, pushover to WHMCS !!
    Always looking for Linux, WHMCS, Support Desk work. PM for details

  3. #3
    Join Date
    Jun 2004
    Posts
    197
    great thanks,

    but I do not see those values in my httpd.conf file now. do I have to put them anywhere special?

    and aparently I need to use a prefork module?

    thanks

  4. #4
    Join Date
    Sep 2002
    Location
    Top Secret
    Posts
    11,687
    Putting them anywhere SHOULD be fine. I have my own global limits set @ the top of the config.
    WHMCS Guru - WHMCS addons, management, support and more.
    WHMCS Notifications Extended - Add slack, hipchat, SMS, pushover to WHMCS !!
    Always looking for Linux, WHMCS, Support Desk work. PM for details

  5. #5
    Join Date
    Jun 2004
    Posts
    197
    thanks dude

  6. #6
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    169
    Try editing httpd-mpm.conf and/or httpd-mpm.conf_2.0 in your extra folder.
    SwedenDedicated Unmanaged & managed solutions.
    Dedicated Servers, VPS and colocation in Sweden - Stockholm.
    100Mbit Unmetered servers
    Follow us on twitter @swedendedicated

  7. #7
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,750
    Usually ServerLimit value will be absent and the default value is 256. You can add this line to the mpm module section along with MaxClients.
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  8. #8
    Join Date
    Jun 2004
    Posts
    197
    I have 2 httpd-mpm.conf files:

    /usr/local/apache/conf/original/extra/httpd-mpm.conf
    /usr/local/apache/conf/extra/httpd-mpm.conf

    Which one should I edit?

    Thanks

  9. #9
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,750
    Execute the following command and see which conf file is used.

    /usr/local/apache/bin/httpd -V
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  10. #10
    Join Date
    Jun 2004
    Posts
    197
    just looks like the main config file, unless I;m missing somthing:

    Server version: Apache/2.2.6 (Unix)
    Server built: Dec 4 2007 09:51:01
    Cpanel::Easy::Apache v3.2.0 rev3351
    Server's Module Magic Number: 20051115:5
    Server loaded: APR 1.2.11, APR-Util 1.2.10
    Compiled using: APR 1.2.11, APR-Util 1.2.10
    Architecture: 32-bit
    Server MPM: Prefork
    threaded: no
    forked: yes (variable process count)
    Server compiled with....
    -D APACHE_MPM_DIR="server/mpm/prefork"
    -D APR_HAS_SENDFILE
    -D APR_HAS_MMAP
    -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
    -D APR_USE_SYSVSEM_SERIALIZE
    -D APR_USE_PTHREAD_SERIALIZE
    -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
    -D APR_HAS_OTHER_CHILD
    -D AP_HAVE_RELIABLE_PIPED_LOGS
    -D DYNAMIC_MODULE_LIMIT=128
    -D HTTPD_ROOT="/usr/local/apache"
    -D SUEXEC_BIN="/usr/local/apache/bin/suexec"
    -D DEFAULT_PIDLOG="logs/httpd.pid"
    -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
    -D DEFAULT_LOCKFILE="logs/accept.lock"
    -D DEFAULT_ERRORLOG="logs/error_log"
    -D AP_TYPES_CONFIG_FILE="conf/mime.types"
    -D SERVER_CONFIG_FILE="conf/httpd.conf"
    I guess its not loading httpd-mpm.conf ?

  11. #11
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,750
    Add inside the file /usr/local/apache/conf/httpd.conf. Search for MaxClients and add above that line.
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  12. #12
    Join Date
    Jun 2004
    Posts
    197
    Quote Originally Posted by david510 View Post
    Add inside the file /usr/local/apache/conf/httpd.conf. Search for MaxClients and add above that line.
    "MaxClients" isnt in my httpd.conf file anywhere.... thats the first thing I looked for.

    This is why this situation is so confusing.... all the configuration options that were in my apache 1.3 config file are gone now I have upgraded to apache2.2

    I can add everything in there if its the "right" thing to do.. I just thought there was another config file somewhere that I SHOULD be editing...

    I read somewhere else that I should add the following to httpd.conf:

    <IfModule mpm_prefork_module>
    ServerLimit 1024
    StartServers 10
    MinSpareServers 10
    MaxSpareServers 20
    MaxClients 1024
    MaxRequestsPerChild 0
    </IfModule>

  13. #13
    Join Date
    Jun 2004
    Posts
    197
    <IfModule mpm_prefork_module>
    ServerLimit 1024
    StartServers 10
    MinSpareServers 10
    MaxSpareServers 20
    MaxClients 1024
    MaxRequestsPerChild 0
    </IfModule>
    i added the above to httpd.conf and it works fine

    thanks guys

  14. #14

    it's in the apache2.conf

    Quote Originally Posted by strato View Post
    i added the above to httpd.conf and it works fine

    thanks guys
    not sure if you checked but that code is already in the apache2.conf. at least on mine it is. you may not have to add it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •