I struggled to find out why my server broke down frequently these days. And I think I found it.
My Apache HTTP server was configured with MaxClients at 50, the default AJP connector’s connections number was about 15, and the Tomcat’s maxThreads was 150. So the bottleneck would be AJP connector, especially all my connection-heavy Comet application was serving about 20 Gtalk/MSNLive simultaneous connections. It is obviously it will break down the servers. And after switching my Gtalk/MSNLive into query modes, it still broke down the server. The reason may be the bottleneck of Apache HTTP server’s 50 maximum connections.
I updated all the configuration to 256 for maximum simultaneous connections. Hope server won’t break down for Comet application from now on.
For more about extreme maximum simultaneous connections, please read articles:
http://jha.rajeev.googlepages.com/web2push
http://www.stdlib.net/~colmmacc/Apachecon-EU2005/scaling-apache-handout.pdf
http.conf
<IfModule prefork.c>
#StartServers 1
#MinSpareServers 1
#MaxSpareServers 5
StartServers 3
MinSpareServers 5
MaxSpareServers 10
#ServerLimit 50
ServerLimit 256
#MaxClients 50
MaxClients 256
MaxRequestsPerChild 4000
</IfModule>
server.xml
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009"
maxThreads="256" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" protocol="AJP/1.3" />