My plex media server is taking a very long time to scan even just 1 movie in to the library. I have tried optimizing the database. It is doing this for all of my movies and tv shows that are on 3 different drives. Here is a small portion of a scanner log. What is shown in the log happens for hours sometimes before the scanner actually starts picking up media.
UPDATE: It only does this when media is added and plex does a partial scan. I can do a full scan without issue. Is there anything I can try, to fix this issue?
@PMAdmin said:
I have the same issue, can a ninja look into this?
Look into what ? which forum post ? which Plex Media Server.log log file ? Which Plex Media Scanner.log file ? Which Plex Media Scanner Analysis.log log file?
I mean in the post above from @thompry. Its a section with only 200 directories.Way less then in my previous post. database optimized and bundles removed.
Command issued:
“c:\Program Files (x86)\Plex\Plex Media Server\Plex Media Scanner.exe” -v --scan --refresh --section 16 --directory “G:\_incoming\TV”
I get the following, look at the time stamp:
Plex Media Scanner.log
Jun 15, 2016 22:59:54.846 [36392] INFO - Plex Media Scanner v0.9.17.2.2159-2bd156c - Microsoft PC - build: windows-i386
Jun 15, 2016 22:59:54.848 [36392] INFO - Windows version: 10.0 (Build 10586), language nl-NL
Jun 15, 2016 22:59:54.848 [36392] INFO - 4 3093 MHz processor(s): Architecture=0, Level=6, Revision=10759 Processor Identifier=Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
Jun 15, 2016 22:59:54.848 [36392] DEBUG - “c:\Program Files (x86)\Plex\Plex Media Server\Plex Media Scanner.exe” -v --scan --refresh --section 16 --directory “G:\_incoming\TV”
Jun 15, 2016 22:59:54.839 [33764] DEBUG - Opening 20 database sessions to library, SQLite 3.8.9, threadsafe=1
Jun 15, 2016 22:59:55.036 [33764] DEBUG - It took 15.625000 ms to retrieve 392 items.
Jun 15, 2016 23:00:02.257 [33764] DEBUG - It took 62.500000 ms to retrieve 0 items.
Jun 15, 2016 23:00:04.284 [33764] DEBUG - It took 78.125000 ms to retrieve 1 items.
Jun 15, 2016 23:00:05.279 [33764] DEBUG - It took 62.500000 ms to retrieve 0 items.
Jun 15, 2016 23:00:10.279 [33764] DEBUG - It took 62.500000 ms to retrieve 0 items. Jun 15, 2016 23:00:12.272 [33764] DEBUG - It took 62.500000 ms to retrieve 0 items. Jun 15, 2016 23:03:00.154 [33764] DEBUG - It took 62.500000 ms to retrieve 0 items. Jun 15, 2016 23:06:18.676 [33764] DEBUG - It took 15.625000 ms to retrieve 392 items. Jun 15, 2016 23:13:39.088 [33764] DEBUG - It took 15.625000 ms to retrieve 392 items. Jun 15, 2016 23:19:35.639 [33764] DEBUG - Scanning TV using en(Plex Series Scanner) with 201 current media items in the database…
Jun 15, 2016 23:19:35.643 [37608] DEBUG - HTTP requesting GET http://127.0.0.1:32400/:/metadata/notify/cullTimeline?librarySectionID=16&sinceTime=1466024375
Jun 15, 2016 23:19:35.698 [37608] DEBUG - HTTP success requesting GET http://127.0.0.1:32400/:/metadata/notify/cullTimeline?librarySectionID=16&sinceTime=1466024375
Jun 15, 2016 23:19:35.757 [33764] DEBUG - Performing a scan with ‘Plex Series Scanner’ (language: en virtual: 0).
Jun 15, 2016 23:19:35.757 [33764] DEBUG - * Scanning G:_incoming\TV
Jun 15, 2016 23:19:35.758 [33764] DEBUG - * Scanning directory G:_incoming\TV (parent: no)
Jun 15, 2016 23:19:35.759 [33764] DEBUG - Adding subdirectory for scanner:
Runs fine from here
The following Plex Media Scanner log is after ive optimized the database,cleaned bundles and emptied the trash:
Jun 16, 2016 22:15:47.450 [46500] INFO - Plex Media Scanner v0.9.17.2.2159-2bd156c - Microsoft PC - build: windows-i386
Jun 16, 2016 22:15:47.451 [46500] INFO - Windows version: 10.0 (Build 10586), language nl-NL
Jun 16, 2016 22:15:47.452 [46500] INFO - 4 3093 MHz processor(s): Architecture=0, Level=6, Revision=10759 Processor Identifier=Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
Jun 16, 2016 22:15:47.452 [46500] DEBUG - “c:\Program Files (x86)\Plex\Plex Media Server\Plex Media Scanner.exe” -v --scan --refresh --section 16 --directory “G:_incoming\TV”
Jun 16, 2016 22:15:47.441 [46796] DEBUG - Opening 20 database sessions to library, SQLite 3.8.9, threadsafe=1
Jun 16, 2016 22:15:47.621 [46796] DEBUG - It took 31.250000 ms to retrieve 393 items.
Jun 16, 2016 22:22:07.800 [46796] DEBUG - It took 15.625000 ms to retrieve 393 items.
Jun 16, 2016 22:28:13.769 [46796] DEBUG - It took 15.625000 ms to retrieve 393 items.
Jun 16, 2016 22:30:19.482 [46796] DEBUG - It took 62.500000 ms to retrieve 1 items.
Jun 16, 2016 22:34:24.360 [46796] DEBUG - It took 62.500000 ms to retrieve 0 items.
Jun 16, 2016 22:34:28.713 [46796] DEBUG - Scanning TV using en(Plex Series Scanner) with 202 current media items in the database…
Jun 16, 2016 22:34:28.715 [46560] DEBUG - HTTP requesting GET http://127.0.0.1:32400/:/metadata/notify/cullTimeline?librarySectionID=16&sinceTime=1466108068
Jun 16, 2016 22:34:28.732 [46560] DEBUG - HTTP success requesting GET http://127.0.0.1:32400/:/metadata/notify/cullTimeline?librarySectionID=16&sinceTime=1466108068
Jun 16, 2016 22:34:28.854 [46796] DEBUG - Performing a scan with ‘Plex Series Scanner’ (language: en virtual: 0).
Jun 16, 2016 22:34:28.854 [46796] DEBUG - * Scanning G:_incoming\TV
Jun 16, 2016 22:34:28.856 [46796] DEBUG - * Scanning directory G:_incoming\TV (parent: no)
Jun 16, 2016 22:34:28.859 [46796] DEBUG - Adding subdirectory for scanner:
The main activity is on the file:
c:\Users<user>\Appdata\Local\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db(and -wal file)
CPU active on 20+ processes connecting to this file
The main activity is on the file:
c:\Users<user>\Appdata\Local\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db(and -wal file)
CPU active on 20+ processes connecting to this file
20+ processes or 20+ threads ?
There should not be that many plex processes running accessing the database.
You are running the scanner through command line. What is the server doing at that time?
Does the problem arise when you do not use the command line and let the server do its own scanning (either periodic or automatic)? May be you are clashing with scan jobs fired by the server
Would like to see screenshot of the active processes and which are trying to access the database. And also what plex processes are running when you fire your command line job. Testing this out after a restart and then zipping copy of whole Logs folder may give some clues
When optimizing - you mentioned optimize, clean bundles, clear trash. Could you try with the optimize being the last of these actions.
20+ processes or 20+ threads ?
There should not be that many plex processes running accessing the database. Well in the log it says: DEBUG - Opening 20 database sessions to library, SQLite 3.8.9, threadsafe=1
You are running the scanner through command line. What is the server doing at that time? Nothing, no videos are being played.
Does the problem arise when you do not use the command line and let the server do its own scanning (either periodic or automatic)? May be you are clashing with scan jobs fired by the server A regular refresh action takes less time. I also see the processing indicator in Plex. This takes minutes before i see the proccessing indicator when i do it through commandline
Would like to see screenshot of the active processes and which are trying to access the database. And also what plex processes are running when you fire your command line job. Testing this out after a restart and then zipping copy of whole Logs folder may give some clues Attached the screenshot.
When optimizing - you mentioned optimize, clean bundles, clear trash. Could you try with the optimize being the last of these actions. Done, below the log after i did clean bundle, clear trash and optimize. Then i’ve restarted Plex.
Command: “c:\Program Files (x86)\Plex\Plex Media Server\Plex Media Scanner.exe” -v --scan --refresh --section 15 --directory “G:_incoming\MOVIES-SD”
Tried other section, allot smaller, but same issue i gues (slow)
Jun 17, 2016 11:00:22.705 [36700] INFO - Plex Media Scanner v0.9.17.2.2159-2bd156c - Microsoft PC - build: windows-i386
Jun 17, 2016 11:00:22.707 [36700] INFO - Windows version: 10.0 (Build 10586), language nl-NL
Jun 17, 2016 11:00:22.707 [36700] INFO - 4 3093 MHz processor(s): Architecture=0, Level=6, Revision=10759 Processor Identifier=Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
Jun 17, 2016 11:00:22.707 [36700] DEBUG - "c:\Program Files (x86)\Plex\Plex Media Server\Plex Media Scanner.exe" -v --scan --refresh --section 15 --directory "G:\_incoming\MOVIES-SD"
Jun 17, 2016 11:00:22.694 [28756] DEBUG - Opening 20 database sessions to library, SQLite 3.8.9, threadsafe=1
Jun 17, 2016 11:00:22.905 [28756] DEBUG - It took 31.250000 ms to retrieve 2001 items.
Jun 17, 2016 11:01:17.150 [28756] DEBUG - It took 31.250000 ms to retrieve 2001 items.
Jun 17, 2016 11:02:11.560 [28756] DEBUG - Scanning Films using en(Plex Movie Scanner) with 52 current media items in the database...
Jun 17, 2016 11:02:11.560 [36476] DEBUG - HTTP requesting GET http://127.0.0.1:32400/:/metadata/notify/cullTimeline?librarySectionID=15&sinceTime=1466152931
Jun 17, 2016 11:02:11.566 [36476] DEBUG - HTTP success requesting GET http://127.0.0.1:32400/:/metadata/notify/cullTimeline?librarySectionID=15&sinceTime=1466152931
Jun 17, 2016 11:02:11.675 [28756] DEBUG - Performing a scan with 'Plex Movie Scanner' (language: en virtual: 0).
Jun 17, 2016 11:02:11.675 [28756] DEBUG - * Scanning G:\_incoming\MOVIES-SD
Jun 17, 2016 11:02:11.676 [28756] DEBUG - * Scanning directory G:\_incoming\MOVIES-SD (parent: no)
Jun 17, 2016 11:02:11.677 [28756] DEBUG - Adding subdirectory for scanner:_
And the command before:
Command:“c:\Program Files (x86)\Plex\Plex Media Server\Plex Media Scanner.exe” -v --scan --refresh --section 16 --directory “G:_incoming\TV”
Jun 17, 2016 11:05:17.096 [33896] INFO - Plex Media Scanner v0.9.17.2.2159-2bd156c - Microsoft PC - build: windows-i386
Jun 17, 2016 11:05:17.097 [33896] INFO - Windows version: 10.0 (Build 10586), language nl-NL
Jun 17, 2016 11:05:17.097 [33896] INFO - 4 3093 MHz processor(s): Architecture=0, Level=6, Revision=10759 Processor Identifier=Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
Jun 17, 2016 11:05:17.098 [33896] DEBUG - "c:\Program Files (x86)\Plex\Plex Media Server\Plex Media Scanner.exe" -v --scan --refresh --section 16 --directory "G:\_incoming\TV"
Jun 17, 2016 11:05:17.086 [44592] DEBUG - Opening 20 database sessions to library, SQLite 3.8.9, threadsafe=1
Jun 17, 2016 11:05:17.288 [44592] DEBUG - It took 15.625000 ms to retrieve 393 items.
Jun 17, 2016 11:11:07.344 [44592] DEBUG - It took 15.625000 ms to retrieve 393 items.
Jun 17, 2016 11:16:52.061 [44592] DEBUG - It took 15.625000 ms to retrieve 393 items.
Jun 17, 2016 11:22:39.790 [44592] DEBUG - Scanning TV using en(Plex Series Scanner) with 202 current media items in the database...
Jun 17, 2016 11:22:39.790 [45268] DEBUG - HTTP requesting GET http://127.0.0.1:32400/:/metadata/notify/cullTimeline?librarySectionID=16&sinceTime=1466154159
Jun 17, 2016 11:22:39.796 [45268] DEBUG - HTTP success requesting GET http://127.0.0.1:32400/:/metadata/notify/cullTimeline?librarySectionID=16&sinceTime=1466154159
Jun 17, 2016 11:22:39.885 [44592] DEBUG - Performing a scan with 'Plex Series Scanner' (language: en virtual: 0).
Jun 17, 2016 11:22:39.885 [44592] DEBUG - * Scanning G:\_incoming\TV
Jun 17, 2016 11:22:39.886 [44592] DEBUG - * Scanning directory G:\_incoming\TV (parent: no)
Jun 17, 2016 11:22:39.887 [44592] DEBUG - Adding subdirectory for scanner:
When i initiate a regular scan within the Plex WebGui, i get this log:
Jun 17, 2016 11:29:41.572 [46488] INFO - Plex Media Scanner v0.9.17.2.2159-2bd156c - Microsoft PC - build: windows-i386
Jun 17, 2016 11:29:41.574 [46488] INFO - Windows version: 10.0 (Build 10586), language nl-NL
Jun 17, 2016 11:29:41.574 [46488] INFO - 4 3093 MHz processor(s): Architecture=0, Level=6, Revision=10759 Processor Identifier=Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
Jun 17, 2016 11:29:41.574 [46488] DEBUG - "C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Scanner.exe" --scan --refresh --section 16
Jun 17, 2016 11:29:41.579 [36992] DEBUG - Opening 20 database sessions to library, SQLite 3.8.9, threadsafe=1
Jun 17, 2016 11:29:41.756 [36992] DEBUG - Scanning TV using en(Plex Series Scanner) with 13362 current media items in the database...
Jun 17, 2016 11:29:41.757 [29268] DEBUG - HTTP requesting GET http://127.0.0.1:32400/:/metadata/notify/cullTimeline?librarySectionID=16&sinceTime=1466154581
Jun 17, 2016 11:29:41.762 [29268] DEBUG - HTTP success requesting GET http://127.0.0.1:32400/:/metadata/notify/cullTimeline?librarySectionID=16&sinceTime=1466154581
Jun 17, 2016 11:29:41.852 [36992] DEBUG - Performing a scan with 'Plex Series Scanner' (language: en virtual: 0).
Jun 17, 2016 11:29:41.852 [36992] DEBUG - * Scanning G:\_nas_mirrored\ARCHIVE-TV-SERIES-3
Jun 17, 2016 11:29:41.852 [36992] DEBUG - * Scanning directory G:\_nas_mirrored\ARCHIVE-TV-SERIES-3 (parent: no)
Jun 17, 2016 11:29:41.853 [36992] DEBUG - Adding subdirectory for scanner:
@PMAdmin said:
20+ processes or 20+ threads ?
There should not be that many plex processes running accessing the database. Well in the log it says: DEBUG - Opening 20 database sessions to library, SQLite 3.8.9, threadsafe=1
They are 20 database connections from one process as can be seen in the screenshot of the Plex Media Scanner PID
@PMAdmin said:
You are running the scanner through command line. What is the server doing at that time? Nothing, no videos are being played.
The only way to tell if the server was doing anything during your command line scanner job would be to have all the log files and may also help to see what SysInternals Process Monitor shows in terms of activities for the the scanner command line PID and the PIDs of the other Plex processes in the system
@PMAdmin said:
Does the problem arise when you do not use the command line and let the server do its own scanning (either periodic or automatic)? May be you are clashing with scan jobs fired by the server
Would like to see screenshot of the active processes and which are trying to access the database. And also what plex processes are running when you fire your command line job. Testing this out after a restart and then zipping copy of whole Logs folder may give some clues A regular refresh action takes less time. I also see the processing indicator in Plex. This takes minutes before i see the processing indicator when i do it through commandline
That is good to know - indicating there is no database optimization issue. I have edited the title to reflect that.
Still would like to see the logs I asked for - to see what the server was doing at the time. If you run the scanner through command line, I would expect you to have Library Auto Updates disabled and periodic updates either disabled or with sufficient gap between reruns to allow for your manual command line scans
@PMAdmin said:
When optimizing - you mentioned optimize, clean bundles, clear trash. Could you try with the optimize being the last of these actions. Done, below the log after i did clean bundle, clear trash and optimize. Then i’ve restarted Plex.
Thanks
There is a big difference between the command line job timings and the internally running scanner job
Big gaps in time
Jun 17, 2016 11:00:22.905 [28756] DEBUG - It took 31.250000 ms to retrieve 2001 items.
Jun 17, 2016 11:01:17.150 [28756] DEBUG - It took 31.250000 ms to retrieve 2001 items.
Jun 17, 2016 11:02:11.560 [28756] DEBUG - Scanning Films using en(Plex Movie Scanner) with 52 current media items in the database...
and
Jun 17, 2016 11:05:17.288 [44592] DEBUG - It took 15.625000 ms to retrieve 393 items.
Jun 17, 2016 11:11:07.344 [44592] DEBUG - It took 15.625000 ms to retrieve 393 items.
Jun 17, 2016 11:16:52.061 [44592] DEBUG - It took 15.625000 ms to retrieve 393 items.
Jun 17, 2016 11:22:39.790 [44592] DEBUG - Scanning TV using en(Plex Series Scanner) with 202 current media items in the database
Would like to see all the logs during timings like these
OpenedFilesViewer snapshot taken at the time which one can filter in excel by the database file - to see if it is open at the time of one of these long gaps. You could also run SysInternals Process Monitor and watch it whilst the scanner job is running and hung
Could it be scheduling issue in windows - background jobs taking priority ? See what settings you have in Advanced Settings on Computer Properties
Looks like I’m having the same situation, see link above, but its not in manual command line run its what @thompry said where its a partial scan. partial scan for me takes 8-9 minutes to add or remove one item. Just wondering if there was a resolution to this?