Synology FAQ - Questions, Answers, and How-To's

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.

  1. 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:

  1. Create a Scheduled Task
  2. 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",

  1. Run it
  2. 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.

Go to Index

5 Likes
HW Transcoding not working anymore (Synology Diskstation)
Plex Media doesn't detect automaticaly new media
Certain MKV Files won't Play
Plex connection without remote Access & Insufficent max_user_watches
Is ChuckPA's FAQ 16 still applicable for DSM 7?
Automatic media detection inoperative after DSM 7 upgrade
Automatic Library scanning not working
Indirect playing does not work for SOME title
Unable to find newly added movies
New movies not automatically added
Intro detection taking forever
Plex not auto detecting new tv shows added
Please Help! have tried all I can: EAE timeout! EAE not running, or wrong folder? Synology DS 918+ NAS
Please Help! have tried all I can: EAE timeout! EAE not running, or wrong folder? Synology DS 918+ NAS
Problème scan auto depuis un dossier mapper CIFS
Plex Package infinite load, needs to be restarted at least daily (not loudness bug)
Plex server crashes after deleting media library or optimize database/clean bundles
Plex Media Server - Synology DSM 7 Preview - Issues ( Archive )
Plex Media Server - Synology DSM 7 Preview - Issues ( Archive )
Plex stopped automatically recognizing new files
DSM 7 what should I do
Kein automatischer Scan der Bibliothek
Trouble with DSM 7 Plex Playback Error
PMS won't play EAC3 items. Tried multiple PMS versions
Can't Transcode any video remotely since update
Plex does not see new TV shows
Pesky bug with auto content scanning
DSM 7, Daily Plex server crashes
Certain files refuse to play
Newly added episodes are not recognized
Newly created music library access issue, new to plex and need pointers please
Plex deja de funcionar en mi nuevo nas Synology DS920+
Plex Media Server - Synology DSM 7 Preview - Issues ( Archive )
Plex Media Server - Synology DSM 7 Preview - Issues ( Archive )
Plex Media Server - Synology DSM 7 Preview - Issues ( Archive )
I Updated to 1.25.2.5319 and now nothing is streaming to anywhere
I Updated to 1.25.2.5319 and now nothing is streaming to anywhere
Server only runs for a few minutes
[DS918+ - DSM7] Plex unable to play certain files but on (Android) mobile apps
I need help with a library in plex, constantly scanning it
I need help with a library in plex, constantly scanning it
Library Upgrade Required Failing on Synology DS423+
SOLVED! - Plex gets stuck spinning at 33% with all videos with EAC3 EAC audio (Plex recently stopped playing EAC3)
20% of my movies are not being recognized
Library updater does not manually update library media
Library updater does not manually update library media
Web App Cannot Connect Securely, frequently flips between secure and insecure
PMS routinely crashing on DSM
Latest Plex on DSM 7 Problems with EAC3 5.1 Sound
Witchcraft ?!
Witchcraft ?!
Libraries Not Detecting Changes
I can no longer watch any of my library over cellular network
Server unreachable even in bundled web app
Optimized Versions on Synology DS1821+
Plex on synology not scanning for new media
Somethings Wrong
Auto-Scan doesn't work
Sonic analysis stuck on 6 albums forever + several issues on the log file
Library Autoscan Not Working
Automatic Scan not working with Synology NAS
Music categories don't get scanned automatically
Cannot Transcode files remotely, but remote access is confirmed. Giving me errors
Only CERTAIN titles won't play outside of my LAN
"EAE timeout! EAE not running" error
Files not being added to only one Library
Auto Detect of New Media No Longer Working (Windows and Linux)
Issues with 1) loss of deleted files 2) automatic library scanning
Plex not auto scanning media
Plex stopped responding most of the time
EAC codec issues & iNotify still an issue?
Version 1.32.2.7100 not added new files
Content unavailable until I manually analyze the library
Auto scanning stopped working on Synology NAS
Plex buffering issues (not for all libraries) on Android app / Chromecast / web app, not Windows app
Plex buffering issues (not for all libraries) on Android app / Chromecast / web app, not Windows app
Why isn’t my Plex library being updated?
Ple agents not finding matches for new movies
Large music library keeps removing then adding albums
HW Transcoding Not Working for HVEC/H265 Content (1019+)
Transcoding E-AC3 on Android 14 not working
PMS 1.32.4.7164 : Still have issues with HW Transcoding (Synology DS 1019+)
Moved PMS to New NAS- Transcode of Intros Unable to find Codec
Nach dem Upgrade von "Plex Media Server" Fehler im Log und Abspielprobleme
Library stopped updating
PLEX Creating duplicates of all my music without end
Certain files won't stream over internet, but no problem on home network
Certain files won't stream over internet, but no problem on home network
Plex server on Linux in Docker: frequent transcode errors when not transcoding
Plex will not scan library
Plex library not updating automatically
Plex will not scan library
Plex transcoding stopped working?
Plex transcoding stopped working?
Plex freezing a transcode no matter the client stating out of space
28: no space left on device
Plex stops running every once in awhile? Why?
Trancod error
100% Prozess mit Transcode "convert to wav" brauche hilfe
100% Prozess mit Transcode "convert to wav" brauche hilfe
Error displaying photos + no new media detection
Problems transcoding files with EAC3 sound
Plex Server Showing Spikey CPU Usage
Plex Server Showing Spikey CPU Usage
Synology Suite latest 8555 version analysis title problem, serious problem, urgent help
Libraries don't automatically update when adding new content
Libraries don't automatically update when adding new content
"Conversion failed. The transcoder exited due to an error"
HEVC 10bit main is transcoding fine but HEVC 8bit main is not
S2s_watches Fix
Turned on 'Required' secure connection and can no longer access ANY Plex interface
Auto scan for new media files in library folder not working
Music Library versus number of directories
Plex doesn't scan my NEW files only!
Plex library not updating automatically synology ds218+
Plex Server (Synology DS-3615xs): Playback does not start (stuck on playback spinner)
PMS does not see NAS after changing password
PMS continuously scanning for series intros; tons of errors in console
Plex Server (Synology DS-3615xs): Playback does not start (stuck on playback spinner)
Plex Media doesn't detect automaticaly new media
Libraries not auto scanning on new media being added
Plex Server (Synology DS-3615xs): Playback does not start (stuck on playback spinner)
Plex cannot show newly added files, but existing ones are OK
Plex Consistently Shuts Down Every Day on my Synology
Automatic/Partial Scanning has stopped
There was an unexpected error loading this library
Synology Nas + Temp location for transcoding
Plex 1.40: Error while decoding stream #0:1: No space left on device , is the bug back?
Plex Console shows errors [Notify] Failed to add watch for "<path>" (28: No space left on device)
PMS Shutting down/crashing randomly
Choppy video and freeze up on Shield TV Tube
Download link required for PlexMediaServer-1.19.4.2935 x86_64 spk (for x86 64-bit Intel Synology DS218+)
Cant play video with E-AC-3 audio