Nel caso volessimo aumentare il parametro MaxClient nella nostra configurazione apache ci troveremmo ad un limite di default 256

Vediamo la configurazione a cui vogliamo arrivare

<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 500
MaxRequestsPerChild 0
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
# graceful restart. ThreadLimit can only be changed by stopping
# and starting Apache.
# ThreadsPerChild: constant number of worker threads in each server process
# MaxClients: maximum number of simultaneous client connections
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 500
MaxRequestsPerChild 0
</IfModule>

Facendo ripartire il nostro server otterremo il seguente errore

* Restarting web server apache2 WARNING: MaxClients of 500 exceeds ServerLimit value of 256 servers,
lowering MaxClients to 256. To increase, please see the ServerLimit
directive.
… waiting WARNING: MaxClients of 500 exceeds ServerLimit value of 256 servers,
lowering MaxClients to 256. To increase, please see the ServerLimit
directive.

Occorre quindi impostare 

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#
ServerLimit 500

 

Nb. aumentare il numero massimo di connessioni simultanee comporta di fatto ad un aumento dei processi apache attivi contemporaneamente

Considerando che 1 processo apache occupa dai 10 ai 20 Mb di ram avere 500 processi contemporaneamente attivi comporterà un carico massimo fino a 10Gb di ram 

Quindi occhio ad avere un hardware adeguato

Share →

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *