Categories
Daily Blog Linux

Increasing Inotify Watchers is a Must after Installing Manjaro

When I first installed my WordPress development setup in Manjaro, and typed npm run watch to run some gulp thing in the background, the process would stop and give me an error like “User limit of inotify watches reached”.

If you are doing anything that watches files, often in coding or ide’s or even some music software, you are probably going to have to raise the inotify limit.

To check your max inotify watchers in the terminal, type:

cat /proc/sys/fs/inotify/max_user_watches

The default for Manjaro is this line found in /etc/systemctl.d/50-max_user_watches.conf

fs.inotify.max_user_watches = 16384

Yeah, 16,384 is not enough, based on how fast my gulp process crashes.

We’re changing it to 524288.

fs.inotify.max_user_watches = 524288

Easy Mode in Dolphin and Kate

I manually updated that line above by clicking on the “/” in the top breadrcumb in dolphin, the graphical file browser, and then navigating to the etc and then systemctl.d directories. Clicking on 50-max_user_watches.conf opened it with the Manjaro KDE default Kate text editor.

I changed that one number, hit save, and typed my password. (because you need root privelege to edit systemctl stuff).

Or just type this into the terminal:

echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/50-max_user_watches.conf && sudo sysctl --system

Raising the number of inotify watchers is probably a must for professional work. You’ll see this question dozens of times on stack overflow and github issues.

Now, this is one of the first things I do when I do a fresh installation.

Hat tip to Donny Kurnia on github.

Leave a Reply

Your email address will not be published. Required fields are marked *