FAQ 16: Increase the number of folders Plex can monitor
Applicable to all supported versions of DSM.
When the Linux ‘inotify’ table fills up, this will cause when Plex to stop automatically detecting new media you add to the server. It will also manifest when there are transcoder problems with Dolby audio codecs.
Linux has a default table size which is static. We can increase this at will.
On some versions it’s 8192. On newer kernels, the default is 65536 folders.
This is easy to increase but requires a bit of math.
- First, get the total number of directories in use for your media (movies, series, music, and photos). For each share containing media:
a. File Station.
b. Left Pane
c. Right-click the share
d. Properties
e. Write down the number of folders it finds.
Example:
When done collecting the number of folders in use:
a. Add 32768 to the value
b. Divide by 32768
c. Add 1 to the the Integer result (No fractions here)
e. Multiply by 32768
f. Use this final result. (integer part only)
g. If the number of folders you are using is less than 8192, stop here unless you are about to add a lot more media.
Example: I have 208,244 directories (because I curate a lot of music and photos)
(208244 + 32768) / 32768 = 7.35 -> 7
7 + 1 = 8
8 * 32768 = 262144 (This is the value I use - room to grow)
We do this because we want a multiple of 32768 slots to be allocated. It allocates kernel memory on a memory boundary and allows for future growth.
Create a Scheduled task you will run ONE TIME -OR- when DSM updates and you need to increase the table again.
Here is how it will look in Task Scheduler:
- Create a Scheduled Task
- User defined script
a. Create the task
b. Declare it to run one-time Today only
c. Paste in the contents but use your values.
# Remove any previous s2s_watches_max entries (avoid clutter)
sed -i 's/^s2s_watches_max=.*$//' /etc/synoinfo.conf
sed -i 's/^s2s_watches_max=.*$//' /etc.defaults/synoinfo.conf
# This is an example only. Use your actual result below to add the new value
echo 's2s_watches_max=262144' >> /etc/synoinfo.conf
echo 's2s_watches_max=262144' >> /etc.defaults/synoinfo.conf
When you’ve added your value and clicked 'OK",
- Run it
- Restart DSM (Required to activate)
WARNING:
Due to how Synology manages this capability, you are strongly urged to place ONLY those items which should be monitored in your media.
Cases have been found where “Sample” and “Example” files have been included or the media storage contains unnecessary extra folders.
Please curate your media with care.