Jump to content

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


FrostByte

Recommended Posts

FrostByte

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 logged on with admin privileges.

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

 

 

inotify4.png.27edec15b5fbd22dedd5724c111c9ef0.png

 

2. Paste the following commands under the Task Settings tab

 

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

image.png.c58c374547b7ed61f7e7a43948422c93.png

 

 

3. Click Run to execute the new task (if not logged on as admin then a restart may be necessary)

 

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

 

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 FrostByte
added requirement to be logged on as admin
  • Like 4
  • Thanks 5
Link to comment
Share on other sites

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