Kodi Community Forum

Full Version: KODI freezes while another KODI updates MySQL
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Multiple Kodi 16.1 systems running under LibreELEC 7.0.2. Happy to post this over at LE forums if that's more appropriate, but I don't think this is OS related...

One system runs headless 24/7 and updates the MySQL library on a NAS once per hour using Library Auto Update add-on. That's it's only reason for existence. It's the "Updater".

If anyone happens to be choosing something to watch on any other system when the Updater starts it's scan, the person will see their system freeze for a couple minutes. Clock doesn't change, no response from keyboard or remote. This does not happen if they are looking around the library, only if they happen to select Play on something. Also doesn't happen if they are watching something, all is fine.

Media is also on the same NAS as the MySQL DB. All systems use NSF for accessing the media.

Is there an issue with multiple users called Kodi accessing a SQL DB at the same time? I know nothing about MySQL...

Cheers,

RLW

Sent from my SGH-I337M
Having multiple systems accessing a MySQL Db at the same time is dangerous at best. I would say that if you want to share a single config between multiple systems AND be able to use them at the same time, you might want to look into using Emby as your server app, feeding / syncing libraries to each instance of Kodi running with independent local databases, but identical content having been synced from the Emby server.
Interesting. And yet I and many others have been using MySQL as a backed library for XBMC/KODI for several years without issue, including through multiple KODI updates (4 versions for me to date).The whole point of using a shared database is to provide consistent content and watched status across multiple instances of KODI, and it works well. This single issue described in my post only came about when I created this Updater machine which does library scans/updates hourly. So I can hardly believe that sharing a MySQL library as described in the official KODI Wiki is "dangerous at best"...

With respect, your response seems like a shill for Emby. Ok, shill maybe is too strong... Let's say Emby Evangel... Knee-jerk response: "MySQL oddity? Bad function... try Emby... ". To be fair, I'm sure Emby is a great product - I'm not knocking it at all. But MySQL works very well indeed and I for one appreciate not having additional systems to keep my media centers in sync, as MySQL is there on the NAS otherwise just doing nothing anyway.

Cheers and thanks for your opinion,

RLW
Sharing I don't think is any problem, rather updating. I assume the updating Kodi is getting a table lock from MySQL.

scott s.
.
Yeah, I didn't think sharing was a problem as it's been working with multiple systems simultaneously for a couple years. But now with hourly updates I occasionally note the issue when I happen to be browsing on one system while the Updater does its task.

No biggie, just curious.

Cheers,

Sent from my SGH-I337M
(2017-04-10, 22:22)gibxxi Wrote: [ -> ]Having multiple systems accessing a MySQL Db at the same time is dangerous at best. I would say that if you want to share a single config between multiple systems AND be able to use them at the same time, you might want to look into using Emby as your server app, feeding / syncing libraries to each instance of Kodi running with independent local databases, but identical content having been synced from the Emby server.

That's totally incorrect - MySQL is the recommended/supported solution for sharing database content. Serving multiple systems/clients is exactly what MySQL is designed to do, and generally speaking it does it pretty well. However it does require fairly significant processing requirements (lots of RAM, CPU) and a typical NAS is rarely an ideal platform on which to run it.

I suspect the problem reported by the OP is due to the NAS hardware that is running MySQL being underpowered. When the library scan is running the MySQL server process is busy processing the scan queries, which may result in table locks, and during this time it may be unable to respond to queries from any other clients, so they have to wait. If the NAS is limited in RAM and/or CPU the library scan queries may take a long time to process, meaning that database tables remain locked for extended periods.

Solutions would be to invest in more powerful hardware on which to run MySQL, and/or avoid running full library scans on a regular basis when nothing or little has changed (it's possible via JSON to scan individual directories if you know they contain new content in which case a scan may only take a few seconds).
Good to know, thanks Millhouse. The NAS is an older ReadyNAS Pro and you could very well be right that it's underpowered.

Cheers,
RLW

Sent from my SGH-I337M