J BOSS 6.0.0 Server Crashed when i use AJP Protocol. System showing the below exception continuously.
2012-08-21 16:12:51,750 ERROR [org.apache.tomcat.util.net.JIoEndpoint] (ajp-0.0.0.0-8009-Acceptor-0) Socket accept failed: java.net.SocketException: Too many open files
at java.net.PlainSocketImpl.socketAccept(Native Method) [:1.6.0_24]
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:408) [:1.6.0_24]
at java.net.ServerSocket.implAccept(ServerSocket.java:462) [:1.6.0_24]
at java.net.ServerSocket.accept(ServerSocket.java:430) [:1.6.0_24]
at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:61) [:6.0.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:343) [:6.0.0.Final]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]
Issue is because of max threads & connectionTimeout set in the Server.xml in the JBOSS server.
AJP Protocol's connectionTimeout default value is infinite.
so, connectionTimeout value set to 120000 (2 minutes).
So, problem (Too many open files) never replicated. Its always better to set the optimal configuration setting instead of default values.
To assist this issue some other configuration changes has been made. those are,
"max threads" value for ajp protocol changed from 1500 to 150.
"ulimit -n" value has changed from 1024 to 8192.