1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

MaxClient Apache2

Discussion in 'Plesk 10.x for Linux Issues, Fixes, How-To' started by baudeletm, Jan 11, 2012.

  1. baudeletm

    baudeletm Guest

    0
     
    Hello.

    I am on Plesk 10.4.4 on ubuntu 10.04

    my file /etc/apache2/apache2.conf contain :
    Code:
    ##
    ## Server-Pool Size Regulation (MPM specific)
    ##
    
    # prefork MPM
    # StartServers: number of server processes to start
    # MinSpareServers: minimum number of server processes which are kept spare
    # MaxSpareServers: maximum number of server processes which are kept spare
    # MaxClients: maximum number of server processes allowed to start
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_prefork_module>
        StartServers          5
        MinSpareServers       5
        MaxSpareServers      10
        MaxClients          150
        MaxRequestsPerChild   0
    </IfModule>
    
    # worker MPM
    # StartServers: initial number of server processes to start
    # MaxClients: maximum number of simultaneous client connections
    # StartServers: initial number of server processes to start
    # MaxClients: maximum number of simultaneous client connections
    # MinSpareThreads: minimum number of worker threads which are kept spare
    # MaxSpareThreads: maximum number of worker threads which are kept spare
    # ThreadsPerChild: constant number of worker threads in each server process
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_worker_module>
        StartServers          2
        MinSpareThreads      25
        MaxSpareThreads      75
        ThreadLimit          64
        ThreadsPerChild      25
        MaxClients          150
        MaxRequestsPerChild   0
    </IfModule>
    
    # event MPM
    # StartServers: initial number of server processes to start
    # MaxClients: maximum number of simultaneous client connections
    # MinSpareThreads: minimum number of worker threads which are kept spare
    # MaxSpareThreads: maximum number of worker threads which are kept spare
    # ThreadsPerChild: constant number of worker threads in each server process
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_event_module>
        StartServers          2
        MaxClients          150
        MinSpareThreads      25
        MaxSpareThreads      75
        ThreadLimit          64
        ThreadsPerChild      25
        MaxRequestsPerChild   0
    </IfModule>
    
    I want to change the value of maxclients and other options (because my apache process is satured with 150 clients only).

    I have create a file : /var/www/vhosts/mydomain.fr/conf/vhost.conf with :
    Code:
    <Directory /var/www/vhosts/mydomain.fr/httpdocs>
    StartServers       10
    MinSpareServers    10
    MaxSpareServers    100
    ServerLimit       512
    MaxClients        500
    MaxRequestsPerChild  1000
    </Directory>
    
    then i send this : /usr/local/psa/admin/sbin/httpdmng --reconfigure-domain mydomain.fr


    I got this errors :
    Code:
    stderr:
    Syntax error on line 2 of /var/www/vhosts/ps3thc.fr/conf/vhost.conf:
    StartServers not allowed here
    

    Someone can help me plz ?
     
  2. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,557
    Likes Received:
    1,242
    Location:
    Novosibirsk, Russia
    Just remove

    StartServers 10

    from /var/www/vhosts/mydomain.fr/conf/vhost.conf
     
  3. baudeletm

    baudeletm Guest

    0
     
    I have remove StartServers 10, so
    /var/www/vhosts/mydomain.fr/conf/vhost.conf :
    Code:
    <Directory /var/www/vhosts/mydomain.fr/httpdocs>
    MinSpareServers    10
    MaxSpareServers    100
    ServerLimit       512
    MaxClients        500
    MaxRequestsPerChild  1000
    </Directory>
    
    And next error ... :
    stderr:
    Syntax error on line 2 of /var/www/vhosts/mydomain.fr/conf/vhost.conf:
    MinSpareServers not allowed here
     
    Last edited by a moderator: Jan 11, 2012
  4. Bevan

    Bevan Basic Pleskian

    23
    23%
    Joined:
    Aug 12, 2007
    Messages:
    25
    Likes Received:
    0
    See apache2 doc: http://httpd.apache.org/docs/2.0/en/mod/prefork.html, http://httpd.apache.org/docs/2.0/en/mod/mpm_common.html#maxclients

    The only allowed context of these settings is the global server configuration, so you can't set it for specific vhosts or directories.

    This makes sense because these settings control the number of processes apache starts to wait for incoming requests. The server can not know which vhost/directory is requested before he accepts and processes the incoming request.
     
  5. baudeletm

    baudeletm Guest

    0
     
    Ok thanks a lot for this !
    So, how changing this setting on my plesk / apache install ?
    (ServerLimit
    MaxClients
    MaxRequestsPerChild)
    in /etc/apache2/apache2.conf directly ? This file is not rewrite all the time by plesk after ?
     
  6. Bevan

    Bevan Basic Pleskian

    23
    23%
    Joined:
    Aug 12, 2007
    Messages:
    25
    Likes Received:
    0
    On my system (Debian Squeeze) this file is not touched by Plesk. Plesk integrates its own configuration by adding a file to to /etc/apache2/conf.d. So I would try editing the file directly. But i can't say anything about other systems.
     
Loading...