Jump to content

Fix for RTM not working caused by limited inotify instances/watches


FrostByte
 Share

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.

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

 

sh -c '(sleep 90 && echo 204800 > /proc/sys/fs/inotify/max_user_watches)&'
sh -c '(sleep 90 && echo 10000 > /proc/sys/fs/inotify/max_user_instances)&'

 

inotify3.png.3dc7671f732850bb797be91551cc1269.png

 

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 FrostByte
  • Like 2
  • Thanks 2
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...