0

I'm experiencing issues with the number of files opened increasing over time. If I run my server for about few hours, it'll no more accept any connections. The limit was 1024. I've increased the limit to about 40,000 and still the number is going up everyday and it's just a matter of time until the server stop accepting connections.

is it normal number of open files keep increasing until i restart the server ? and what are the possible scenarios that may cause that problem ?

1 Answer 1

3

is it normal number of open files keep increasing until i restart the server ?

No.

and what are the possible scenarios that may cause that problem ?

Fix whatever application you have running on your system that is leaving file handles open.

Start by examining the output of lsof. This command will return a list of processes and the number of file handles they have open, sorted in decreasing order:

$ sudo lsof | cut -d " " -f 1 | uniq -c | sort -nr
1
  • If you don't see a single process eating them all up with the above command then look at your cron jobs. If you have a script that runs say once every 10 minutes but has a bug in it that causes it never to exit.. and you aren't using some sort of lockfile.. The number of file descriptors opened will slowly increase with every new run until you run out.
    – user143703
    Mar 24, 2014 at 23:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .