• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

MaxClient Apache2

B

baudeletm

Guest
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 ?
 
Just remove

StartServers 10

from /var/www/vhosts/mydomain.fr/conf/vhost.conf
 
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:
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.
 
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 ?
 
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 ?

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.
 
Back
Top