LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Apache MaxClients setting

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Apache MaxClients setting
From: Vincent Deloye <vincent@xxxxxxx>
Date: Wed, 18 Feb 2004 09:01:52 +0100
Hi all,

I have two directors and two webservers with Apache/PHP/MySql. Directors
are managed by heartbeat and ldirectord. My problem is that when the
apache process is stopped and restarted on one webserver for update
needs (databases + PHP files + ...), a few seconds after the service is
not responding and i can see in the apache error_log messages like
"server reached MaxClients setting, consider raising the MaxClients
setting" and a "netstat -anp" shows many connections in CLOSE_WAIT state
from the directors.

My settings are :
ldirectord :
"...
checktimeout=1
checkinterval=5
autoreload=yes
quiescent=no
virtual=<VIP>:80
        fallback=127.0.0.1:80
        real=192.168.2.11:80 masq
        real=192.168.2.12:80 masq
        service=http
        negotiatetimeout = 1
        request="test.html"
        receive="Test page"
        protocol=tcp
        checktype=negotiate
"
Apache :
"...
KeepAlive On
MaxKeepAliveRequests 50
KeepAliveTimeout 5
MinSpareServers 10
MaxSpareServers 20
StartServers 5
MaxClients 256
MaxRequestsPerChild 100
..."
# netstat -anp | grep httpd
tcp        0      0 192.168.2.11:80         0.0.0.0:*
LISTEN      897/httpd
tcp        1      0 192.168.2.11:80         192.168.2.1:58824
CLOSE_WAIT  904/httpd
tcp        1      0 192.168.2.11:80         192.168.2.1:58828
CLOSE_WAIT  901/httpd
tcp        1      0 192.168.2.11:80         192.168.2.1:58816
CLOSE_WAIT  913/httpd
tcp        1      0 192.168.2.11:80         192.168.2.1:58820
CLOSE_WAIT  915/httpd
tcp        1      0 192.168.2.11:80         192.168.2.1:58840
CLOSE_WAIT  940/httpd
tcp        1      0 192.168.2.11:80         192.168.2.1:58844
CLOSE_WAIT  943/httpd
tcp        1      0 192.168.2.11:80         192.168.2.1:58832
CLOSE_WAIT  927/httpd
tcp        1      0 192.168.2.11:80         192.168.2.1:58836
CLOSE_WAIT  930/httpd
tcp        1      0 192.168.2.11:80         192.168.2.1:58856
CLOSE_WAIT  968/httpd
tcp        1      0 192.168.2.11:80         192.168.2.1:58860
CLOSE_WAIT  971/httpd
tcp        1      0 192.168.2.11:80         192.168.2.1:58848
CLOSE_WAIT  954/httpd
tcp        1      0 192.168.2.11:80         192.168.2.1:58852
CLOSE_WAIT  957/httpd
tcp        1      0 192.168.2.11:80         192.168.2.1:58872
CLOSE_WAIT  996/httpd
tcp        1      0 192.168.2.11:80         192.168.2.1:58864
CLOSE_WAIT  982/httpd
tcp        1      0 192.168.2.11:80         192.168.2.1:58868
CLOSE_WAIT  985/httpd
tcp        1      0 192.168.2.11:80         192.168.2.2:47627
CLOSE_WAIT  905/httpd
tcp        1      0 192.168.2.11:80         192.168.2.2:47631
CLOSE_WAIT  902/httpd
tcp        1      0 192.168.2.11:80         192.168.2.2:47619
CLOSE_WAIT  914/httpd
tcp        1      0 192.168.2.11:80         192.168.2.2:47623
CLOSE_WAIT  903/httpd
tcp        1      0 192.168.2.11:80         192.168.2.2:47643
CLOSE_WAIT  942/httpd
tcp        1      0 192.168.2.11:80         192.168.2.2:47647
CLOSE_WAIT  948/httpd
tcp        1      0 192.168.2.11:80         192.168.2.2:47635
CLOSE_WAIT  929/httpd
tcp        1      0 192.168.2.11:80         192.168.2.2:47639
CLOSE_WAIT  933/httpd
tcp        1      0 192.168.2.11:80         192.168.2.2:47659
CLOSE_WAIT  970/httpd
tcp        1      0 192.168.2.11:80         192.168.2.2:47663
CLOSE_WAIT  976/httpd
..."
192.168.2.1 and 192.168.2.2 are the "internal" IPs of directors.

What can i do to correct this pb ? Is it a pb in my apache config ? Or
in ldirectord ?

Many thanks.

<Prev in Thread] Current Thread [Next in Thread>
  • Apache MaxClients setting, Vincent Deloye <=