4

I have an application which keeps giving me the following error.

tail: inotify cannot be used, reverting to polling: Too many open files

I have already followed all the advice I've been able to find on web searches, and have changed the number of open file descriptors in all ways I know how. I've also rebooted the server. What might still be blocking my process from opening more files?

Some useful data:

# lsof | wc -l
8347
$ lsof -u <username> | wc -l
7533
$ cat /proc/sys/fs/file-max
98349
$ cat /etc/security/limits.conf
...
<username>       soft    nofile      32768
<username>       hard    nofile      65536
...
$ ulimit -Hn
65536
$ ulimit -Sn
32768

1 Answer 1

3

Open your terminal and type as

sysctl fs.inotify.max_user_watches

to check current limit. If you want to modify it then type in terminal as root

vim /etc/sysctl.conf

Then at the end add this following line

fs.inotify.max_user_watches = XXXXXX

In the XXXXXX place your desired value.

let me know if you are still facing any issues.

2
  • 2
    Thank you for the direction. It looks like "sysctl" was the last place I needed to go to increase the allowance for file descriptors (particularly the inotify ones). I did however need to increase one more setting in order to solve my issue, fs.inotify.max_user_instances, which I set to 512.
    – sffc
    Jul 9, 2014 at 7:55
  • 2
    An addendum for other people with this issue: you need to run sudo sysctl -p in order to refresh the settings according to /etc/sysctl.conf, and the two settings to add/change in that file are max_user_watches and max_user_instances, both under fs.inotify.
    – sffc
    Jul 9, 2014 at 8:55

You must log in to answer this question.

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