Kodi Community Forum
MySQL Database: Multiple XBMC HTPC's with 1 Shared Library - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: MySQL Database: Multiple XBMC HTPC's with 1 Shared Library (/showthread.php?tid=85654)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29


- tboooe - 2011-03-10

Krazypoloc Wrote:Alright guys I got it all figured out (famous last words). Smile

This is what I did and my music library is almost instantaneous. Commands to be pasted are in bold.

Code:
C:\Documents and Settings\Aaron>[b]mysql -u root -p xbmc_music[/b]
Enter password: ********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.41 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> [b]CREATE INDEX test_idx ON song(idAlbum);[/b]
Query OK, 21514 rows affected (1.50 sec)
Records: 21514  Duplicates: 0  Warnings: 0

mysql> [b]alter table song add index idArtist(idArtist);[/b]
Query OK, 21514 rows affected (0.56 sec)
Records: 21514  Duplicates: 0  Warnings: 0

mysql> [b]alter table song add index idGenre(idGenre);[/b]
Query OK, 21514 rows affected (0.63 sec)
Records: 21514  Duplicates: 0  Warnings: 0

Thats for the music bit....I then added...
Code:
C:\Documents and Settings\Aaron>[b]mysql -u root -p xbmc_video[/b]
Enter password: ********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 5.1.41 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> [b]ALTER TABLE movie ADD INDEX ix_idFile(idFile);[/b]
Query OK, 680 rows affected (0.30 sec)
Records: 680  Duplicates: 0  Warnings: 0

I went to my bedroom system which is over WIFI and browsed to music, only too a second or two. Once inside music there is no delay selecting artists or albums. I queued up a high bitrate lossless (The Pacific Soundtrack) album to test the stability and speed and let it play. Then I went back to the root XBMC menu and went into movies, again only a second or two delay, I browsed movies without any issues, went back to TV Shows, ect, and back and forth without a single issue.

Hope this helps!

Also remember the commands above will only work if you have your mysql configured in your system path.

Thank you. This helps alot. I think that my issues are because of my low powered pcs. Even on my lightweight server which has mysql and the shared thumbnails folder stored locally, it takes about 5 secs to access to music artists library. Once in, selecting an artist is immediate but if I navigate back out to the top level of artists, it takes about 4-5 secs. I am going to move mysql and the thumbs to a higher powered machine to see if that helps.


- FreakinAye - 2011-03-11

Are you suppsoed to add sources to every frontend? My movies are duplicated and I can't figure out why. Cleaning does nothing.

My shows are tripled! Shocked


- Krazypoloc - 2011-03-11

FreakinAye Wrote:Are you suppsoed to add sources to every frontend? My movies are duplicated and I can't figure out why. Cleaning does nothing.

My shows are tripled! Shocked

Yeah my movies are doubled when they get imported....even though only one of them actually links back to the original file. Trying to play a duplicate just loads for a second then goes back to the movie wall. I don't know why it is doing this but would like to get it fixed as well.


- Krazypoloc - 2011-03-14

Anyone have any idea how to fix these duplication issues?


- thaughbaer - 2011-03-14

Hi,
will I have issues with shared thumbnails if I have a mix of Linux and Windows clients or will it be ok as long as the source path is the same ?

Mike


- TugboatBill - 2011-03-14

thaughbaer Wrote:Hi,
will I have issues with shared thumbnails if I have a mix of Linux and Windows clients or will it be ok as long as the source path is the same ?

Mike

You don't use a source path for thumbnails. You create symbolic links to put the shared thumbnails folder into the proper location on each client. I'm using Windows & Live and haven't had any problems, though I don't run them both at the same time (Windows is for testing).


- FreakinAye - 2011-03-15

Krazypoloc Wrote:Anyone have any idea how to fix these duplication issues?

I got mine cleared up. It was caused by not using the exact same name in my sources. I used hostname in one and IP in another. From that point, I wasn't able to get it cleaned up properly, so I scorched earth the DB and dropped all the tables, then started the library from scratch, using identical sources.xml and advancedsettings.xml on each to ensure consistency. All good now.


- sladinki007 - 2011-03-24

well it works pretty OK... once it is started but mine takes about 8 minutes to start Tongue

this is the query that slows the thing down

Quote:| 3 | xbmc | P5QEM.lan:57396 | xbmc_video | Query | 308 | Sending data | select strPath,noUpdate from path where idPath in (select idPath from files join movie on movie.idFi |

once this one is finished the the thing is up and running
tried optimizing my mysql settings but nothing much helps ....

any Mysql pro can make this query a bit easier to digest ?

my database has

26109 tv eps
3650 Movies
24647 Songs

nicely stored on an unraid with 18TB space Rolleyes

i already performed the above mentioned index changes (i was the one who asked for the video one, to the guy who posted it first )

so i guess now the only thing what is left is for XBMC to get better queries to optimize the speed ?


- tboooe - 2011-03-24

sladinki007 Wrote:well it works pretty OK... once it is started but mine takes about 8 minutes to start Tongue

this is the query that slows the thing down



once this one is finished the the thing is up and running
tried optimizing my mysql settings but nothing much helps ....

any Mysql pro can make this query a bit easier to digest ?

my database has

26109 tv eps
3650 Movies
24647 Songs

nicely stored on an unraid with 18TB space Rolleyes

i already performed the above mentioned index changes (i was the one who asked for the video one, to the guy who posted it first )

so i guess now the only thing what is left is for XBMC to get better queries to optimize the speed ?

Wow thats a lot of media! Just out of curiosity, how responsive is your system when you use xbmc's default database? I have a bit more music than you and even when I use xbmc's database it takes up to 5 secs before I can access the library.


- TugboatBill - 2011-03-24

sladinki007 Wrote:well it works pretty OK... once it is started but mine takes about 8 minutes to start Tongue

this is the query that slows the thing down



once this one is finished the the thing is up and running
tried optimizing my mysql settings but nothing much helps ....

any Mysql pro can make this query a bit easier to digest ?

my database has

26109 tv eps
3650 Movies
24647 Songs

nicely stored on an unraid with 18TB space Rolleyes

i already performed the above mentioned index changes (i was the one who asked for the video one, to the guy who posted it first )

so i guess now the only thing what is left is for XBMC to get better queries to optimize the speed ?

With that many items my suggestion would be to look into a fast SSD (SATA3 or PCIe) for your MySQL database.


- hansdampf - 2011-03-24

i like this whole database on one server thing.

is it possible to decide which things are in sync?

i don`t want the watched status to be in the sql database, because in our network there are more people using the same movie server and it would be confusing for them.
on the other hand, on centralized database on the server would make the support for the users easier. i would be in total control over the movie database and make sure all movies get scraped right.


- tboooe - 2011-03-24

hansdampf Wrote:i like this whole database on one server thing.

is it possible to decide which things are in sync?

i don`t want the watched status to be in the sql database, because in our network there are more people using the same movie server and it would be confusing for them.
on the other hand, on centralized database on the server would make the support for the users easier. i would be in total control over the movie database and make sure all movies get scraped right.

You could just turn off the watched flag in the skin....


- TomPiXX - 2011-03-24

hansdampf Wrote:i like this whole database on one server thing.

is it possible to decide which things are in sync?

i don`t want the watched status to be in the sql database, because in our network there are more people using the same movie server and it would be confusing for them.
on the other hand, on centralized database on the server would make the support for the users easier. i would be in total control over the movie database and make sure all movies get scraped right.

You could use different profiles for each user.


- sladinki007 - 2011-03-25

TugboatBill Wrote:With that many items my suggestion would be to look into a fast SSD (SATA3 or PCIe) for your MySQL database.

ok i put off scan on startup and now it only takes him like a minute or 2 to startup

response time is OK i guess
a few seconds to wait before a menu opens but i can live with that ...

difference between a normal database and the mysql is noticable ... the normal database is still a bit quicker in opening menu's
might be due to the skin i use... using transperancy .. and that loads a lot of images ... and the thumbnails is on the unraid ... all through gb network though and jumbo frames enabled

anyway couldn't do without the mysql with 2 htpc and 2 computers who regualary use xbmc in the house


- Krazypoloc - 2011-03-29

sladinki007 Wrote:ok i put off scan on startup and now it only takes him like a minute or 2 to startup

response time is OK i guess
a few seconds to wait before a menu opens but i can live with that ...

difference between a normal database and the mysql is noticable ... the normal database is still a bit quicker in opening menu's
might be due to the skin i use... using transperancy .. and that loads a lot of images ... and the thumbnails is on the unraid ... all through gb network though and jumbo frames enabled

anyway couldn't do without the mysql with 2 htpc and 2 computers who regualary use xbmc in the house

I think the SSD idea is a great one. Doesn't matter how fast the network is, the database queries are doing super heavy random I/O, almost any raid setup would fall short for this type of operation, but an SSD would shine.

I am going to play around a bit and see if I can optimize the video database, I will report back with my findings!

*Edit*
Ok when selcting movies it was taking a few seconds for me (under 10 seconds). I added the below and now it is instantaneous as far as I know.....I'm doing this over RDP so its hard to tell if it is truly instant or not, but it is much faster and there doesn't seem to be any hesitation.

Code:
mysql> ALTER TABLE movie ADD INDEX idMovie(idMovie);
Query OK, 690 rows affected (0.16 sec)
Records: 690  Duplicates: 0  Warnings: 0

And this
Code:
mysql> ALTER TABLE movie ADD INDEX idFile(idFile);
Query OK, 690 rows affected (0.11 sec)
Records: 690  Duplicates: 0  Warnings: 0