Problem with running out of file handles


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:

  1. Check the number of open files on the server: lsof | wc
  2. 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.

  1. Edit /etc/sysctl.conf and change fs.file-max= to some number. NOTE: file handles use memory, so be conservative in what you do.
  2. run sysctl -p to apply the changes.
Tags: file system, linux
Last update:
2014-04-11 07:57
Author:
Rod
Revision:
1.0
Average rating:0 (0 Votes)

You can comment this FAQ

Chuck Norris has counted to infinity. Twice.

Records in this category

Tags