Kodi Community Forum

Full Version: Slow Movie Play with MySQL
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've just gone through the HOW-TO:Sync multiple libraries ... Excellent idea!

Followed all the steps, and got it all working. One issue I'm having is the speed at which a movie starts playing is really slow. It takes about 30 seconds for the movie to actually start playing from the Movie Library. If I turn off Library Mode, it starts the same movie in 3 seconds or less. I'm using this format for both MySQL path and source path: smb://<server_ip>/share/Movies

I've tried the tweaks from here, to speed up MySQL, with no difference.

Any ideas?
Some details about the setup you're using would be helpful so the experienced folks on here can chime in. Couple this with appropriate log information and you're more likely to get an appropriate response.

The forums have guidelines on what information to post when reporting a suspected problem, take a moment to review these and supply the suggested information.
Anod - Thanks for the suggestion!

Here is a bit more detail on this issue...

About my system:
- 2 quad core E5504 Xeons
- 20GB RAM
- OCZ Vertex 3 SATA III 2.5" SSD (used for OS and apps, incl XBMC)
- 4 2TB Hitachi HDS5C3020ALA632 drives in ZFS RAIDZ (used for Data... movies are here)

- Running Linux Mint 11 (Katya) 64 bit, up to date as of Feb 21, 2012
- Installed XBMC version 10.1
- Movies are stored on a ZFS file system with RAIDZ, and shared via SMB
- uname -a = Linux SERVER1 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

Any movie I select (no matter the codec), the playback does not start for about 30 seconds using Library mode. When I switch to File Mode, and browse to the same movie, the movie plays within 3 seconds.

I've uploaded 2 log files to Pastebin. Both include logs from playing the same movie 3 times in a row, except one is playing the movie using Library Mode, and the other one is File Mode.
(1) xbmc.log-LibraryMode - this is the one that starts movie play really slow
(2) xbmc.log-FileMode - plays movies within 3 seconds

PS: I replaced the movie titles in both logs with <name of the movie> ... didn't want to advertise my movie list online.

Please let me know if you need more information. Thanks in advance!
Have you tried bumping up the max connections in your my.cnf?

Also how large of a library are you dealing with? I also just recently set up mysql central library stuff for a large TV library, and while i have noticed some small level of slowdown on starting playback, its nowhere near the 30s you are seeing (and i haven't even built indexes yet either).
Hi Lukano! I just tried to bump up the max_connections to 1000. Still the same issue.
My movie library has 853 titles.
Ok, is your mysql server on the same machine as the xbmc client?

I now recall reading a comment elsewhere from someone who had similar slowdowns, and in their case it was due to dns lookups done by the mysql server against the clients accessing it. This would explain why you only have the delay in library mode, which calls the sql database, and not in file mode which ignores the db.

You can try adding host file entries on both client(s) and servers for all of the clients/servers involved (hostname ip.ad.dr.ess). Alternately i believe theres a my.cnf config option to enable/disable dns lookups by the server. I cant seem to find it with a quick search, but im also typing/researching from my smartphone Smile
The MySql server is on the same machine. I also do have the "skip-name-resolve" line in my my.cnf file.