I ran out of file handles on one of my Linux servers. I believe it was due to rkhunter, which may open multiple files at the same time, but I am not sure. Here is the solution:
- Check the number of open files on the server: lsof | wc
- Check maximum number of file handles available: cat /proc/sys/fs/file-max
If #1 is close to #2, you should increase the number of available file handles. This can be done without a restart. See https://confluence.atlassian.com/display/CONF26/Fix+%27Too+many+open+files%27+error+on+Linux+by+increasing+filehandles which is one of the main articles I used when tracking down the solution.
- Edit /etc/sysctl.conf and change fs.file-max= to some number. NOTE: file handles use memory, so be conservative in what you do.
- run sysctl -p to apply the changes.