Library scan is very slow

“Run a partial scan when changes are detected”
Does this really do anything? I’ve yet to see any changes with this on or off.

Scanning a folder, it checks every single file if there is any change at all inside the folder. Not just the changes as you would expect. Here is an example of an “Other video” library, which 2 new files are introduced:

Feb 09, 2018 12:53:28.477 [3680] DEBUG - Adding file for scanner: Z:\Fights\Boxing\boxing.2018.02.03.lawrence.okolie.vs.isaac.chamberlain.720p.hdtv.x264-verum.mkv
Feb 09, 2018 12:53:28.478 [3680] DEBUG - Adding file for scanner: Z:\Fights\Boxing\boxing.2018.02.03.ted.cheeseman.vs.carson.jones.720p.hdtv.x264-verum.mkv
Feb 09, 2018 12:53:28.703 [3680] DEBUG - Directory had 210 files, database had 208 files, can’t skip.
Feb 09, 2018 12:53:28.937 [3680] DEBUG - * Scanning Boxing (2017)
Feb 09, 2018 12:53:28.937 [3680] DEBUG - Looking for path match for [Z:\Fights\Boxing\Boxing.2017.01.28.Carl.Frampton.Vs.Leo.Santa.Cruz.720p.HDTV.x264-PLUTONiUM[eztv].mkv]
Feb 09, 2018 12:53:28.941 [3680] DEBUG - Path matched, we’re reusing media item 631682
Feb 09, 2018 12:53:30.690 [3680] DEBUG - * Scanning Boxing (2017)
Feb 09, 2018 12:53:30.690 [3680] DEBUG - Looking for path match for [Z:\Fights\Boxing\Boxing.2017.01.28.Carl.Frampton.Vs.Leo.Santa.Cruz.HDTV.x264-PLUTONiUM[eztv].mkv]
Feb 09, 2018 12:53:30.691 [3680] DEBUG - Path matched, we’re reusing media item 631683
… and continues for all 210 files, not just the two new ones.

The scanner also goes into each subfolder regardless is anything is changed, hence does not check the modified timestamp. Very time-consuming if you have large libraries.

Between scanning each subfolder, it also does a directory list of the root folder. So if you have 1000 movie folders, it does 2000 (1000 list root, 1000 list subfolders) directory listings instead of 1001 (1 list root, 1000 list subfolders). Only affects performance if you are using a slow network share.

While I can’t help you with you issue I can answer your question.
For me, Run a partial scan when changes are detected is enable and PLEX will scan new content only then stops. The whole process is fast as 10 seconds for single library items and 30 seconds for dual-library items.

@NewPlaza said:
While I can’t help you with you issue I can answer your question.
For me, Run a partial scan when changes are detected is enable and PLEX will scan new content only then stops. The whole process is fast as 10 seconds for single library items and 30 seconds for dual-library items.

Not sure what you mean by single/dual library items. If you introduce a new file or folder to a largish library. Do you get any time diffrence (or in the log) scanning with this option on or off?

Here is my logs testing on a small library, if you compare them side by side plus the time. The options changes nothing.

@Johnsen1408 said:

@NewPlaza said:
While I can’t help you with you issue I can answer your question.
For me, Run a partial scan when changes are detected is enable and PLEX will scan new content only then stops. The whole process is fast as 10 seconds for single library items and 30 seconds for dual-library items.

Not sure what you mean by single/dual library items. If you introduce a new file or folder to a largish library. Do you get any time diffrence (or in the log) scanning with this option on or off?

Ah. What I mean is… Imagine this. I have 2 libraries, one called KidMovies and the other AllMovies.
KidMovies points to a single folder on my hard drive. eg D:\PlexMovies\KidStuff
AllMovies points to the same single folder on my hard drive and also includes a second folder.
eg. D:\PlexMovies\KidStuff & D:\PlexMovies\NotKidFriendlyStuff
When I add anything in the kids folder PLEX scans it twice. Once for the library KidMovies and once for AllMovies.

I did test between the setting on/off… There is about a 10 minute time difference. With it enabled the PLEX scanner from start to finish takes about 10 seconds per library.

With the setting off. PLEX takes about 5-10 minutes per library…

Okay I understand. However that not what I am seing on my system. Looking at the logs I’ve attached previously it makes no diffrence here.

The option might not be as effective with a network share.
Depends also on your particular file server/NAS software and also whether the clock is correctly set on both the plex server and the file server.

All the clocks are dates are correctly set.
A fileserver or NAS would be where this feature is the most needed since they usually are high enough speed but regrettably high latency compared to local storage.

Comparing the dates available they are the same on the mount as I have available locally:


For comparison, I tested listing out all files and folders:
C:\Users\aj>echo %time%
14.57.38,97
C:\Users\aj>dir /S Z:

Total Files Listed:
116982 File(s) 186 929 650 121 636 bytes
64404 Dir(s)
C:\Users\aj>echo %time%
14.58.37,19

So as you can see; even though plex needs to check everything, why does it use hours and hours, when a complete list only takes 1 minute.

1 Like

@Johnsen1408 said:
Okay I understand. However that not what I am seing on my system. Looking at the logs I’ve attached previously it makes no diffrence here.

This may sound like a stupid question… but… you are saving the setting in PlexWeb, right?
I know for me I have to scroll down the page to click SAVE CHANGES.

Yes its saved. Just double checked, and ran another test, same result.

‘Run scanner tasks at a lower priority’.
set that to off and re-test.

Although you’re doing a “list files” test on the network share, that may not tell the whole story. Plex does a lot more than just get a list of the files. It also checks the header of each file to determine its container type and codec/file information. Given that you have 116,000+ files, even adding a 1/100th of a second for each would end up adding two full minutes to the scan. I would guess that either 1. the latency to your NAS is killing the Plex scan performance, or 2. the number of directories is hampering Plex’s scanning algorithm. I tend to put many dozens of movie files into a directory rather than have a separate dir for each movie.
To get a benchmark of your network connection to your NAS, try this: https://totusoft.com/index.php

@rook3300 said:
Although you’re doing a “list files” test on the network share, that may not tell the whole story. Plex does a lot more than just get a list of the files. It also checks the header of each file to determine its container type and codec/file information. Given that you have 116,000+ files, even adding a 1/100th of a second for each would end up adding two full minutes to the scan. I would guess that either 1. the latency to your NAS is killing the Plex scan performance, or 2. the number of directories is hampering Plex’s scanning algorithm. I tend to put many dozens of movie files into a directory rather than have a separate dir for each movie.
To get a benchmark of your network connection to your NAS, try this: Totusoft

The issue is not how fast PLEX scans, it’s why does it re-scan all the files. I do not see the issue myself. The PLEX scanner only scans the new file and doesn’t re-scan all the existing files. So the question is, why is PLEX scanning all file when only one was added.
BTW: Great program. Used it many times to test network speed.

I have replaced files. That is removed some and added some others. But after the scan, on my tv, I see the same original files and not the new ones. When I try to play the removed files, of course I get the message they are not there.