문제

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]
도움이 되었습니까?

해결책 2

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.

다른 팁

  • check the maximum number of fd in system by entering cat /proc/sys/fs/file-max if you have 65535 it should be ok but you can increase it to 200000
  • check the ulimit by entering 'ulimit -n' , on my side that gaves 1024, so i increase it in the file /etc/security/limites.conf and add :

    * soft nofile 2048

    * hard nofile 2048

Finally you can check the fd byt entering lsof -p xxx|wc -l

all those explanation come from this which saves my life each time i faced this issue.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top