To investigate this kind of issues under Linux you can monitor the maximum number of open files / file descriptors (FD) for your application's process. It's not a solution to increase the limit of FDs in your system. You should eliminate the root cause of the problem in your application. Look for the unclosed files/connections. You might have missed something. In case of connections
Here are steps:
*** know your java process number
ps aux | grep java
1743
*** know the number of opened files by your process:
lsof -p 1743 | wc -l
975
*** know your file descriptor limit (soft and hard)
ulimit -Sn
ulimit -Hn
*** to display maximum number of open file descriptors:
cat /proc/sys/fs/file-max
***** System-wide File Descriptors (FD) Limits
*** increase the maximum number of open files by setting a new value in kernel variable /proc/sys/fs/file-max as follows (login as the root):
sysctl -w fs.file-max=100000
*** if the limit has to be set after reboot, append: fs.file-max = 100000 to:
vi /etc/sysctl.conf
*** log out and in or call:
# sysctl -p
*** verify:
sysctl fs.file-max
or
cat /proc/sys/fs/file-max
***** User Level FD Limits
*** set user level limits:
vi /etc/security/limits.conf
add:
httpd soft nofile 4096
httpd hard nofile 10240

No comments:
Post a Comment