Jump to content

Extremely slow "Scan Media Library"


Recommended Posts

Posted

Hi All,

 

Long time Emby user, lifetime supporter, first time poster. I have gone through the forums and found several other users that were having similar issues with media scan times. 

 

Let me start with my setup:

 

Emby VM:

ESXi 6.5

Ubuntu 16.04

2 cores of a Xeon 1650 v2

8GB of ECC DDR3 RAM

Emby installed on an SLC enterprise Intel SSD (X25-E SSDSA2SH064G1)

Media stored on ZFS z2 (2 pools of 8x WD4001FYYG SAS drives)

HBA: IBM m1015 (passed through to VM)

 

My issue is the media scanning takes 8 - 10 hours. I have been forced to reduce the scan time to once a week, otherwise the server is essentially in a constant state of scanning media. Now I do have a very large data set, approximately 26,000 files. I originally just assumed this much data would take that long to scan, but I have seen from other posts on this forum that users with similar sized libraries are able to scan in under 30 minutes. This makes me very jealous! 

 

The scan will start off great, making fast progress until it gets to about 68% at which point it creeps along 68.01... 68.02... etc for about 8 hours until it finally completes. 

 

I have disabled every setting I could find that could possibly impact this scan:

Download artwork and metadata from the internet DISABLED

chapter image extraction DISABLED

Download images in advance DISABLED

Extract chapter images during the library scan DISABLED

Group movies into collections DISABLED

Reduced the Metadata downloaders to only one "TheMovieDb"

Image fetcher set to only one "TheMovieDb"

Image fetcher set to maximum number of backdrops per item: 1

Image set to only grab Primary, Logo, Thumb images 

NO sync or conversion settings enabled

NO plugins installed or enabled

 

With the above, I still had the same long scan times. I am hoping the log file will shed some light, but there is a lot of IP address information etc and I do not feel comfortable uploading it. If someone can shed some light on what we would be looking for in the log file, I can try and find that portion and upload it. 

 

I just ended up putting my settings back to my desired configuration and it also had no impact on the scan times. 

 

Let me know what further info is needed to get to the bottom of this, or are my expectations just unrealistic?

 

Thanks

Posted

Hi there, please attach the emby server log from a library scan.  You can also PM it to me. Thanks.

Posted

Hi Luke,

 

PM has been sent. 

 

Thanks

Posted

Hi, for one you could try removing all plugins. Both of your installed plugins can impact the library scan.

Second, and this is more drastic, but you could switch to our newer installation package:

 

https://emby.media/download

 

Our newer packages are based on Microsoft .NET Core rather than mono, and they will perform better. However, in order to do this you would have to uninstall your current installation, and then install with the new package. 

Posted

Hi Luke,

 

Thanks again for the quick response. I was hoping there was some obvious issue you would find in the logs. I looked through them and could not find anything. That being said, I will give the new version of Emby a try, I have never been a big fan of mono. 

mastrmind11
Posted (edited)

Hi Luke,

 

Thanks again for the quick response. I was hoping there was some obvious issue you would find in the logs. I looked through them and could not find anything. That being said, I will give the new version of Emby a try, I have never been a big fan of mono. 

I can say from first hand experience, the new core package is leaps and bounds above the mono shit.  I watched the superbowl last night w maybe 1 hickup...  I used to get 10 pauses during normal bs Kardahsian episodes w/ mono.

Edited by mastrmind11
Posted

I have removed the old emby-server installation and installed the new. 

 

I have disabled all plugins

 

System does seem to be running a lot better, but the scan has been running for about an hour so far and appears to be moving at about the same pace.

 

Is it possible that there is just a bunch of media that it cannot match and it is continuing to search for those same items over and over again?

 

Thanks

Posted

It probably just takes a bit of time to deep scan those drives.

Posted

I am seeing a lot of errors like this: 

2018-02-06 00:00:00.146 Info HttpServer: HTTP Response 400 to 192.168.1.199. Time: 6ms. http://192.168.1.8:8096/emby/Items/5821434ee9b63c1394b4fac65c318669/Ancestors?UserId=0decf491e4d54f108a0c698cd7a97349&format=json 
2018-02-06 00:00:01.000 Info TaskManager: Daily trigger for Start new log file set to fire at 2/7/18 12:00:00 AM, which is 1439.98332272167 minutes from now.
2018-02-06 00:00:01.065 Info HttpServer: HTTP GET http://192.168.1.8:8096/emby/Items/180710177b977b208a1220551ebaa32e/Ancestors?UserId=0decf491e4d54f108a0c698cd7a97349&format=json. UserAgent: 
2018-02-06 00:00:01.071 Error HttpServer: Error processing request
	*** Error Report ***
	Version: 3.2.70.0
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
	Operating system: Unix 4.4.0.112
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: True
	Processor count: 2
	Program data path: /var/lib/emby
	Application directory: /opt/emby-server/system
	System.ArgumentNullException: Value cannot be null.
	Parameter name: item
	   at Emby.Server.Implementations.Dto.DtoService.GetBaseItemDtoInternal(BaseItem item, DtoOptions options, List`1 allCollectionFolders, User user, BaseItem owner)
	   at Emby.Server.Implementations.Dto.DtoService.GetBaseItemDto(BaseItem item, DtoOptions options, User user, BaseItem owner)
	   at MediaBrowser.Api.Library.LibraryService.GetAncestors(GetAncestors request)
	   at lambda_method(Closure , Object , Object )
	   at Emby.Server.Implementations.Services.ServiceExecGeneral.<Execute>d__2.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.Services.ServiceHandler.<ProcessRequestAsync>d__15.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.HttpServer.HttpListenerHost.<RequestHandler>d__73.MoveNext()
	System.ArgumentNullException
	   at Emby.Server.Implementations.Dto.DtoService.GetBaseItemDtoInternal(BaseItem item, DtoOptions options, List`1 allCollectionFolders, User user, BaseItem owner)
	   at Emby.Server.Implementations.Dto.DtoService.GetBaseItemDto(BaseItem item, DtoOptions options, User user, BaseItem owner)
	   at MediaBrowser.Api.Library.LibraryService.GetAncestors(GetAncestors request)
	   at lambda_method(Closure , Object , Object )
	   at Emby.Server.Implementations.Services.ServiceExecGeneral.<Execute>d__2.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.Services.ServiceHandler.<ProcessRequestAsync>d__15.MoveNext()
	--- End of stack trace from previous location where exception was thrown ---
	   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
	   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
	   at Emby.Server.Implementations.HttpServer.HttpListenerHost.<RequestHandler>d__73.MoveNext()

When trying to visit the GET request manually in a browser, it says "Authentication Token Required" are these errors normal? 

Posted

Hi Luke,

 

I was more worried about the log errors then me being able to view the page directly in a browser.

 

Are the errors in the log posted above "normal?" There appear to be hundreds of them. 

Posted

Well whoever is sending that request is not supplying a user agent so i don't even know where that's coming from. but that's not coming from any emby app. I would just allow the initial scan to complete.

Posted

OH! That makes a lot more sense, I was wondering why the 192.x.x.199 address was listed towards the top. 

 

Thanks again for the fast replies

  • 5 months later...
Posted (edited)

Just wanted to update this topic

 

I am no longer having abnormally long library scan times as of 3.5.0, I have ran the full library scan 3 times now and the longest one took just shy of 3 hours. It previously was taking almost 8 hours to fully scan. 

 

I have made no environment changes, but there appear to be a lot of changes in this version of Emby. Some related to improving TVdb queries, improved library search times, along with things like "ensure all folders that start with a '.' are ignored."

 

I am not sure which item fixed the issue, but thank you very much for your continued development. 

Edited by darkapec
Posted

Thanks for the feedback !

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...