sysctl.si › Parameters › fs.inotify.max_user_watches
fs.inotify.max_user_watches
How many files one user can watch for changes. IDEs and file syncers hit this.
- Default
- 8192 to 65536
- Typical value
- 524288
When to change it
Fixes the inotify watch limit reached error in IDEs and file syncers. Each watch uses a small amount of kernel memory.
How it works
inotify lets programs ask the kernel to report file changes. Editors, build tools, file syncers and container tools use it. fs.inotify.max_user_watches limits how many files and folders one user can watch at once.
The default depends on the kernel version and RAM. Older kernels use 8192, which large projects exceed quickly. Each watch uses a small amount of kernel memory, roughly 1 KB.
Signs you need to change it
- Node.js tools report ENOSPC: System limit for number of file watchers reached.
- VS Code warns that it is unable to watch for file changes in a large workspace.
- Syncthing, Dropbox or similar tools stop noticing changes.
Recommended values by workload
- Developer workstation
- 524288
- Large monorepo
- 1048576
- Server without file watchers
- Keep the default
Common mistakes
- Confusing it with fs.inotify.max_user_instances, which limits how many inotify instances a user can create. Raise that one if tools report too many inotify instances.
- Setting an extremely high value on a small machine. 524288 watches can use up to about 0.5 GB of kernel memory if fully used.
- Expecting a per-process limit. It applies to the whole user.
Check the current value
sysctl fs.inotify.max_user_watches
Change it until the next reboot
sudo sysctl -w fs.inotify.max_user_watches=524288
Make it permanent
echo "fs.inotify.max_user_watches = 524288" | sudo tee /etc/sysctl.d/99-custom.conf sudo sysctl --system
Related parameters
fs.file-max · fs.inotify.max_user_instances
Generate a full sysctl config for your server
Values are starting points. Test on a staging machine and measure before and after.