Lots of MySQL traffic

First off I love OSMC! Previously I was using Raspbmc since it was in beta.

I recently upgraded 4 of my Raspberry Pi’s(3 RPi B 512MB and 1 RPi 2) from the last version of Raspbmc to the latest version of OSMC.

I then noticed that all 4 Pi’s are causing a LOT of MySQL traffic which is causing a lot of disk activity on my virtual machine host.

Some more info on my network. All my Pi’s boot from NFS root and sync to a MySQL server. Both the NFS and MySQL servers are VM’s. I have 2 pi’s connect to one DB and the other 2 Pi’s connecting to a different DB(different users). I am using the trakt.tv add-on but only on my RPi 2.

MySQL Stats from phpMyAdmin:

Network traffic since startup: 2.1 GiB
This MySQL server has been running for 0 days, 19 hours, 33 minutes and 34 seconds. It started up on Aug 22, 2015 at 03:23 PM.

I enabled debug on my RPi 2 last night and the following appears roughly every 5 minutes:

21:27:12 2807.475830 T:1774244896 DEBUG: RunQuery took 117 ms for 188 items query: select * from movie_view WHERE ((movie_view.playCount IS NULL OR movie_view.playCount < 1))
21:27:13 2808.063477 T:1774244896 DEBUG: RunQuery took 104 ms for 986 items query: select * from episode_view WHERE ((episode_view.playCount IS NULL OR episode_view.playCount < 1))
21:27:13 2808.492188 T:1774244896 DEBUG: RunQuery took 2 ms for 0 items query: select * from musicvideo_view
21:27:13 2808.503174 T:1774244896 DEBUG: GetAlbumsByWhere query: SELECT albumview.* FROM albumview WHERE albumview.strReleaseType = ‘album’
21:27:13 2808.504395 T:1774244896 DEBUG: GetAlbumsByWhere - query took 1 ms
21:27:13 2808.514160 T:1774244896 DEBUG: GetArtistsByWhere query: SELECT artistview.* FROM artistview WHERE (artistview.idArtist IN (SELECT song_artist.idArtist FROM song_artist) OR artistview.idArtist IN (SELECT$
21:27:13 2808.515137 T:1774244896 DEBUG: Time to retrieve artists from dataset = 2
21:27:13 2808.528564 T:1774244896 DEBUG: GetSongsByWhere query = SELECT songview.* FROM songview WHERE ((CAST(songview.iTimesPlayed as DECIMAL(5,1)) < 1))
21:27:15 2810.005127 T:1774244896 DEBUG: Skin Widgets: Total time needed to request random queries: 0:00:02.666995

Any ideas as to what may be causing this and how I can stop it from checking the DB so often?

If anyone needs more info please let me know.

Any help would be greatly appreciated!

Thanks

The MySQL traffic is being caused by a addon called “Skin Widgets”.

To stop it from talking so much to the MySQL database you can disable or change the frequency that it updates “Radom Items”. Add-on > Services > Skin Widgets > Configure

Thanks again to Milhouse over on the kodi.tv forums!

1 Like

You can always run mysql showprocesslist to see what queries are running as well if you’re ever working with an application that doesn’t print its queries in debugging mode.

Sam