My English is like 3years old baby.
Recently, I made a website with Many File Access.
Unfortunately, My tomcat gave me this following error message
Fatal: Socket accept failed
java.net.SocketException: Too many open files
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:408)
at java.net.ServerSocket.implAccept(ServerSocket.java:462)
at java.net.ServerSocket.accept(ServerSocket.java:430)
at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:61)
at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:352)
at java.lang.Thread.run(Thread.java:662)
org.apache.tomcat.util.net.JIoEndpoint$Acceptor run
This happens when I send request in short time, I guess there too many stream opened for this job.
Does anybody know how to solve this problem.
My Environment are { tomcat 6.0.35, java 1.6.0_31, centos 5 } Ah, This only happens on Linux;
thank you.
Check the limit allocated by the system
cat /proc/sys/fs/file-nr
(last number)
Allocate more if needed
Edit /etc/sysctl.conf
Add/change fs.file-max = xxxxx
Apply changes sysctl -p
Check cat /proc/sys/fs/file-max
You may also have user limits set.