[solved] YASQLI (Yet another SQL issue) --> SLOW!!
#1
Question 
Hi there

Like most of us I want to make the best out of the limited performance of the pi. For this I followed some popular suggestions, i. e.
  • Use a speed-optimised build of openELEC (OpenELEC-RPi.arm-Rbej-Version-Gotham-Popcornmix-Branch(09.10.2013) / 20131009130752-r15789)
  • Bought/installed the available media codecs
  • Dual boot with SD card and USB pen drive
  • Move the database storing the movie art content to an external device

Everything works really well and the interface is quiet snappy. It is only when I move the database to an external host, that the performance takes a significant hit (see stats below). FYI, this is my network setup:
  • Windows Server 2012 Essentials, with username and password protected (SMB) network shares
  • Installed MySQL 5.1.72 database on the windows server containing the network shares (installed using the Microsoft Web Platform Installer)
  • The operating system of the server as well as MySQL and all of its databases are stored on an SSD
  • Wired gigabit ethernet (I know the rpi only has 100 Mbit/s) on all media devices
  • Average latency of the data connection between the rpi and the server = 1.2 ms
  • All known devices have static IPs (the shares on openELEC don't use hostnames either, so no resolving)
  • No huge movie collections as of now, N=34, only the movie share is set up in openELEC

Here's how long the rpi takes for different tasks, before vs. after moving the SQL database to the local server (times measured subjectively, with each task executed multiple times (except initial boot)).
  • Initial boot: ~30 seconds vs. 3+ minutes (rpi has issues finding the databses, according to log file, so it first must create them)
  • Subsequent boots: ~30 seconds, no difference
  • With NO scraper enabled, opening the folder containing the movies: 1 second vs. 8 seconds
  • With NO scraper enabled, starting a movie: 2-3 seconds vs. 10-20 seconds
  • With NO scraper enabled, movie playback: fluid once started, no difference
  • With NO scraper enabled, stopping a movie: instant vs. 1 second
  • With scraper enabled, opening the folder containing the movies: 2 seconds vs. 12-15 seconds
  • With scraper enabled, opening the movie library: 2 seconds vs. 13-20 seconds
  • With scraper enabled, starting a movie: 2-3 seconds vs. 10-14 seconds
  • With scraper enabled, movie playback: fluid once started vs. severe stuttering
  • With scraper enabled, stopping a movie: instant vs. 10 seconds

So as you can see, in my case using an external server for the MySQL database renders the openELEC experience unusable. Notice, that even when absolutely no media share is set-up in the rpi, even then will it take 7-8 seconds to open the (empty) videos folder. Also, there is severe lag when navigating one level back or forth in the videos folder hierarchy.

What do you think could be the reason for this dramatic impact? As it stands, I might be keeping the database on the USB drive itself, at least for now.

Cheers, chefe
Reply
#2
1. You're using a very old Gotham build, try a more recent nightly (see the testing thread)
2. You're using an old-ish version of MySQL - why not use v5.5 (although avoid v5.6, assuming that still has problems)
3. NFS is better than SMB
4. debug log (wiki) - how long are your SQL queries taking?
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#3
Hi MilhouseVH,

thanks for your input. Fair point regarding the newer nightly build, I'll give it a go.

I'm using the older MySQL version, since I was recommended to install additional software on my windows server only though the afore mentioned "web platform installer" from MS. I had the choice to install either version 5.1 or 5.5. But when choosing the latter, the installation executable was not found online by the WPI, so I opted for 5.1. If it is not unwise to install software directly on the server os (like I would be doing on my regular desktop workstation), I would roll-back the server to a previous state and reinstall a different MySQL version.

As for NFS/SMB, the pi is the only linux-based computer on by network. All my other clients are Windows PCs which derive the access to network shares from the Active Directory and this is working perfectly, I would not want to change anything for these clients. Naturally I chose SMB because that meant network sharing was ready to go out of the box. Is it possible to share the same folders with both SMB and NFS? Of course the NFS folders need to be secured with username and password.

I'll post the debug log in an edit to this post.

Thanks again, and cheers


########### EDIT #############

xbmc.log @ http://xbmclogs.com/show.php?id=127751

What did I do? (maybe this is helpful in deciphering the log)
After a reboot, I ...

entered the movie library
scrolled 3 movies to the right
showed the info for that movie
pressed play
fast forwarded to ~41 minutes
let it play for a while
pressed stop
went to the home screen
re-entered the movie library

after that any entries in the file relate to me trying to save the logfile to an usb drive Wink
note, that this is still the old version of openelec
Reply
#4
Hi again,

FYI

in the meantime I have tried a newer built. Though this does indeed really help a lot in terms of performance (i.e. opening time of the libaries, etc), I have found navigating the user interface (even without SQL setup) to be more a bit more slow/choppy than on my previous install. So I reverted back and decided to not go down the SQL route. Moreover, opening libaries still takes 6 seconds, which is a huge improvement over my earlier situation but still I can manage 2s from the USB install without SQL. I reconsidered my usage scenario, so I'll not use multiple instances of xbmc. A SQL setup should therefore not be necessary/advantageous.

But in the end, although I did not end up using the SQL setup, I still consider my question answered, since using the newer built really does the trick improving the SQL performance. Thanks MilhouseVH!
Reply

Logout Mark Read Team Forum Stats Members Help
[solved] YASQLI (Yet another SQL issue) --> SLOW!!0