Increasing the amount of inotify watchers
Pages 13
- Home
- Duplicate directory errors
- Getting the polling fallback message?
- Increasing the amount of inotify watc hers
- Increasing the amount of inotify watchers
- Increasing the amount of inotify watchers for info on how to fix this.
- Mac OSX
- Quickfixes, known issues and workarounds
- Ruby version requirements
- Support for older versions of Ruby
- Tips and Techniques
- Troubleshooting
- Windows
Installation
Issues and Troubleshooting
- Ruby version requirements
- Troubleshooting
- Quickfixes, known issues and workarounds
- Support for older versions of Ruby
Errors
Tips and Techniques
Clone this wiki locally
If you are not interested in the technical details and only want to get Listen to work:
- If you are running Debian, RedHat, or another similar Linux distribution, run the following in a terminal:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p- If you are running ArchLinux, run the following command instead (see here for why):
echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --systemThen paste it in your terminal and press on enter to run it.
The technical details
Listen uses inotify by default on Linux to monitor directories for changes. It's not uncommon to encounter a system limit on the number of files you can monitor. For example, Ubuntu Lucid's (64bit) inotify limit is set to 8192.
You can get your current inotify file watch limit by executing:
$ cat /proc/sys/fs/inotify/max_user_watchesWhen this limit is not enough to monitor all files inside a directory, the limit must be increased for Listen to work properly.
You can set a new limit temporary with:
$ sudo sysctl fs.inotify.max_user_watches=524288
$ sudo sysctl -pIf you like to make your limit permanent, use:
$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
$ sudo sysctl -pYou may also need to pay attention to the values of max_queued_events and max_user_instances if Listen keeps on complaining.
More info
- Manual of inotify(7)
- Blog post: limit of inotify