Jump to content

How to fix RTM not working caused by limited inotify instances/watches


Recommended Posts


A common reason Emby's Real Time Monitoring (RTM) stops working on Synology NAS is because the Unix set user limit on inotify instances and/or watches has been reached as a result of a large number of changes for instances to process and/or the total amount of folders, files, etc that need to be monitored by watches.

When RTM stops working you may start to see errors in your server logs like the following where the default number of user watches (8192) has been reached.  A similar error will show up when the default inotify instances (128) is reached.

System.IO.IOException: System.IO.IOException: The configured user limit (8192) on the number of inotify watches has been reached, or the operating system failed to allocate a required resource.

To increase the number of inotify instances and/or watches create the following task in DSM control panel Task Scheduler.

1. Create a Triggered Task...User-defined script to run at Boot-up





2. Paste the following commands under the Task Settings tab


sysctl fs.inotify.max_user_watches=1048576;
sysctl fs.inotify.max_user_instances=4096;




3. Click Run to execute the new task

The task will then rerun during every boot to prevent the changes from being reverted back to default.


To check that your changes took affect you can optionally run the following commands in Terminal

cat /proc/sys/fs/inotify/max_user_instances
cat /proc/sys/fs/inotify/max_user_watches


If your library gets really big and the limit of user watches is again reached, then just increase the number again.  The maximum number of watches allowed in Unix is 524,288 and each used watch takes about 1kb of memory on a 32-bit system (double on 64-bit).  However, it will only use what is needed based on the number of items being watched.


Edited by Happy2Play
Updated method
  • Like 4
  • Thanks 5
Link to comment
Share on other sites

This topic is now closed to further replies.
  • Create New...