Slow scanning for movies but not for TV shows

Server Version#: 4.14.1

Hey everyone, I’ve been working on improving my scan speeds in order to detect new content better / faster.

My current setup looks like this:

  • Windows PC running PMS
  • NFS mounted network shares (I’ve tried TCP, UDP, and TCP + UDP with no discernable effect in scan speed)
  • unRAID server hosting the network share using 5400 RPM 6 GB/s spin disks
  • Plex movies library is structured like this: …/movies/{movie_name} (movie_year}/{movie_name}.{ext}
  • Movies library is using The Movie Database agent
  • TV Shows is using TheTVDB agent

When running scans, I run these commands similar to these via cygwin on the Windows PC:

  • time Plex Media Scanner.exe --scan --section 1 (movies)
  • time Plex Media Scanner.exe --scan --section 2 (tv shows)

Over the weekend I did work to refresh all of the metadata, analyze the libraries, and empty the trash (in addition to updating to NFS mount instead of UNC path).

I don’t recall my scan times prior to the work I did over the weekend, but as it currently stands the movies scan takes ~18.5 hours, and the tv shows scan takes ~45 seconds.

Does anyone know what could be wrong with my setup / how I can reduce the scan time for my movies section?

How big is your library, movies & tv?

I currently have ~11k movies and ~300 tv shows.

Why are you using NFS with a Windows server?
If your server is really running on Windows, I recommend you to use the default SMB/CIFS protocol.

I changed to NFS because I saw comments that were saying that NFS is supposed to be a faster protocol.

Prior to the weekend, though, I was running SMB 3 and it was just as slow to scan the Movies.

That may be true if you are on Linux/“Unixoid” OS, but not on Windows.

Avoid putting several hundred files (or even thousands) into one folder.
Every file operation is much faster with just a few files in a folder. Which means use “one folder per movie”.

That’s the way I have it setup. My movies are structured like:
X:\Movies\{movie_name} ({movie_year})\{movie_name}.{ext}

Perfect!
Then I’m stumped. It might be something totally unrelated. Do you see the slowness in regular file manager access as well i.e. outside of Plex?

Perhaps some anti virus software getting its hand on the file first and slowing down all other access until it has scanned the whole gigabyte-sized file…

I’m able to browse the folder using File Explorer pretty quickly.

I ran this script, which I think may have some info on what’s going wrong. It says:

160714 files in library
126403 files missing analyzation info
0 media_parts marked as deleted
3 metadata_items marked as deleted
0 directories marked as deleted
31694 files missing deep analyzation info.

No matter how many times I scan, analyze, refresh, empty the trash, the number of files missing analyzation info and deep analyzation info remains pretty much the same.

1 Like

Deep analysis is done during the server maintenance hours.
If your file storage is not reachable during this time (for instance because the NAS is shut down or the WiFi Access point is off or the whole server is off), then it will never get created.

I think the issue is the files missing analyzation (not deeply). I have a feeling my database thinks some files are there, when they actually aren’t, and it isn’t clearing them from the database… or something.

Edit your libraries, go to the ‘Add Folders’ tab and inspect the folder path(s) in there.
Each path must be:

  • still existent
  • accessible (permissions etc)
  • not completely empty!

The path for my Movies exists and is mapped correctly.

I investigated my hunch that it had to do with the files missing analyzation, but as it turns out those were mostly photos.

I’m grasping at straws at this point, but does anyone think it could be because my movies don’t have the year in the filename?

e.g.,
X:\Movies\{movie_name} ({movie_year})\{movie_name} {movie_year}.{ext}
instead of
X:\Movies\{movie_name} ({movie_year})\{movie_name}.{ext}

Unlikely, because it is actually the folder name which is more important for matching. (if you’re using one-folder-per-movie)

And if the item is already matched, it shouldn’t take long for the scanner to pass over this folder during regular scans.
Which brings me to:
Settings - Server - Library - ‘Show Advanced’ - Run a partial scan when changes are detected
Is this activated?

And are the items actually ‘matched’?
You can determine if an item is ‘unmatched’ by the presence of the ‘Match’ menu item. On already-matched items, this turns into ‘Fix Match’.

I initially had partial scanning enabled, but have disabled it because I saw threads that mentioned that PMS can’t detect changes (well) on network shares (even when mounted). That’s why I was hoping to disable it and run full scans on an interval instead.

As far as matching goes, ~all of my movies appear to be matched, with maybe a few exceptions that I missed when manually verifying the metadata.

If the file share is connected to a drive letter
and you have pointed the library to a folder instead of the naked drive letter
and the file share is hosted by either a genuine Windows machine or a NAS with SMB 3.0 support [?]
then this partial scanning should work (and save much time).

I can switch back and re-enable partial scanning, but I’d still like to try to solve the slow scanning overall for my movies library. I’ve seen some threads where people mentioned that scanning a similar size library was on the order of minutes, and some even on the order of seconds.

Partial scanning would certainly be really helpful, but I don’t like the idea of a full scan taking 18+ hours to complete. :confused:

@OttoKerner I’ve re-enabled partial scanning, but what I’m observing now is that it will add the movies but then run a full scan anyway. I’ve also enabled push notifications from Radarr to my Plex.

My settings currently look like this:

image

Do you know what could be causing this / how to fix it?