Today, Tomcat found an error every time he ran the mission Java.net.SocketException:Too many open files,
By looking at the document, it was discovered that the system initialization was done by forgetting to set the Ulimit value so that the default value of 1024 was always used.
Then immediately modify the configuration file
echo "* Soft nofile 200000" >>/etc/security/limits.confecho "* hard nofile 200000" >>/etc/security/limits.co Nfulimit-shn 200000 # # Valid for the current window, after closing
But again run the task when found error still, so various search, finally think of Tomcat after modifying Ulimit did not restart. Problem resolution after reboot.
Find related documents for the following reasons:
If program A is already running, Ulimit-n is 1024 at this time;
Then set ulimit-n 2048, then run program B;
Exit the current shell user, login shell again, run program C;
At this time only the B program uses 2048, the other uses is 1024.
Reference: http://www.th7.cn/system/lin/201309/45075.shtml
This article from "Trojan Rain Heart" blog, declined reprint!
Java.net.SocketException:Too Many open files