If you’re experiencing errors related to inotify — such as
- “Too many open files”
- “User limit on inotify watches reached”
— on your VPS or Dedicated Server, you likely need to increase the inotify watch limit. This is a common issue with CSX and similar tools that rely heavily on filesystem notifications.
Follow these steps to resolve it:
1️⃣ Access your server via SSH
- Connect to your VPS or dedicated server as
root
or a user withsudo
privileges:ssh root@your-server-ip
2️⃣ Increase the inotify watch limit
Run the following command to raise the maximum number of user watches to 524288
(a safe recommended value):
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
✅ What this does:
- Adds
fs.inotify.max_user_watches=524288
to/etc/sysctl.conf
, making the setting persistent across reboots. - Immediately applies the change with
sysctl -p
.
3️⃣ Special note: OpenVZ/Virtuozzo containers
If you are on an OpenVZ or Virtuozzo VPS, you may need to execute the command inside your container context.
Replace 145
with your actual container ID:
vzctl exec 145 echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
4️⃣ Verify the new limit
To confirm that the new watch limit is applied:
cat /proc/sys/fs/inotify/max_user_watches
It should output:
524288
✅ That’s it! You’ve now increased the inotify watch limit, which should resolve most CSX-related issues involving file monitoring limits.