xbmc on Atv2 is extremely slow after configuring MySQL

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
jpcolin Offline
Member
Posts: 64
Joined: Aug 2011
Reputation: 0
Post: #16
Ok removed the substitution for the thumbs, still no go.

I folloewd your toturial Ozymandyaz.

created a new user in myphp (synology) with username: xbmc, password xbmc
Granted all access..

here is my log, there is something wrong with the db!
http://pastebin.com/efbYtmhh
find quote
Ozymandyaz Offline
Member
Posts: 84
Joined: May 2011
Reputation: 0
Location: Toronto, ON
Post: #17
Ok, I see the issue, there are empty databases named xbmc_video and xbmc_music. In the past you needed to create those, but now it screws up XBMC... Go into phpmyadmin and delete those databases. You only want the ones that end with numbers to remain, I.e. xbmc_video60 and xbmc_music19.

I only have my iPhone right now but if you get stuck I can post a video later Smile this happened to me a few times too... I think it's common enough that I should post an update about it...

Guide for MySQL database using Synology NAS
http://youtu.be/3PmmDtK65ks

Silent AppleTV with Crystalbuntu
http://quixventure.com/2011/12/crystalbu...roduction/
find quote
DLeavy Offline
Fan
Posts: 328
Joined: Jun 2011
Reputation: 8
Post: #18
^^ what OZYMandyaz said - there are a lot of old instructions (e.g. Lifehacker) that are out of date and have you performing steps that aren't necessary, like creating the databases in MySQL.

reason I'm replying, is that I did notice from your log that you're running RC2. Any reason why you're not upgrading to Eden final? Note that if you're looking to share your library, they will all need to be on the same XBMC release. I'm not saying this will fix your issue with performance (but, hey, it might). Just seems to make sense to upgrade from the release candidate to Eden final.
find quote
jpcolin Offline
Member
Posts: 64
Joined: Aug 2011
Reputation: 0
Post: #19
ok indeed i followed some time ago another tutorial saying i had to create those databases...
i'll try to delete them... and keep you informed.

Wel the reason i don't update to the latest is that everything works fine, no buffering at all,...
and i have read some post saying there is buffering with the latest...
so i'm often think : if it ain"t broken don't fix it!

At the moment i only have 1 xbmc running, but i'm preparing for ATV3, so..... ;-)
find quote
Ozymandyaz Offline
Member
Posts: 84
Joined: May 2011
Reputation: 0
Location: Toronto, ON
Post: #20
I have two ATV1 (Crystalbuntu) boxes, two ATV2s (one on 4.3 and one on 4.4) and a few Windows boxes all running the Eden final release =) Go for the upgrade!

And... up till a few months ago my guides also had the wrong info about creating the initial databases =(

Guide for MySQL database using Synology NAS
http://youtu.be/3PmmDtK65ks

Silent AppleTV with Crystalbuntu
http://quixventure.com/2011/12/crystalbu...roduction/
(This post was last modified: 2012-04-13 15:50 by Ozymandyaz.)
find quote
jpcolin Offline
Member
Posts: 64
Joined: Aug 2011
Reputation: 0
Post: #21
ok it seems to work for mysql, now i'm going to try the path substitution.
but how can use path substitution with NFS and the rest (database and movies) in SMB?
@Ozymandyaz ?
find quote
mcfreiz Offline
Member
Posts: 70
Joined: Oct 2007
Reputation: 0
Post: #22
having problems finding/editing this file. anyone have detailed instructions on a synology dms 4
(This post was last modified: 2012-04-14 15:06 by mcfreiz.)
find quote
Ozymandyaz Offline
Member
Posts: 84
Joined: May 2011
Reputation: 0
Location: Toronto, ON
Post: #23
(2012-04-13 18:35)jpcolin Wrote:  ok it seems to work for mysql, now i'm going to try the path substitution.
but how can use path substitution with NFS and the rest (database and movies) in SMB?
@Ozymandyaz ?



Hi jpcolin -

Its really easy actually, the path substitution is only used for the thumbs so it in no way interferes with anything else. You set it up like this in the advanced settings:

Code:
<pathsubstitution>
    <substitute>
      <from>special://masterprofile/Thumbnails/</from>
      <to>nfs://192.168.1.90/volume1/XBMC/Thumbnails_XBMC1/</to>
    </substitute>
</pathsubstitution>

The <to> section is the only line that ever changes since you will need to choose the protocol and path to your thumbs. If you want SMB, use "smb://<PATH>" for NFS it's "nfs://<PATH>" etc... In your sources you choose what protocol you want for the actual media files, but they do not need to be the same as the protocol used for the path substitution =)

Now... You just need to make sure you can make your NFS server work =)

Guide for MySQL database using Synology NAS
http://youtu.be/3PmmDtK65ks

Silent AppleTV with Crystalbuntu
http://quixventure.com/2011/12/crystalbu...roduction/
find quote
jpcolin Offline
Member
Posts: 64
Joined: Aug 2011
Reputation: 0
Post: #24
(2012-04-14 19:48)Ozymandyaz Wrote:  
(2012-04-13 18:35)jpcolin Wrote:  ok it seems to work for mysql, now i'm going to try the path substitution.
but how can use path substitution with NFS and the rest (database and movies) in SMB?
@Ozymandyaz ?



Hi jpcolin -

Its really easy actually, the path substitution is only used for the thumbs so it in no way interferes with anything else. You set it up like this in the advanced settings:

Code:
<pathsubstitution>
    <substitute>
      <from>special://masterprofile/Thumbnails/</from>
      <to>nfs://192.168.1.90/volume1/XBMC/Thumbnails_XBMC1/</to>
    </substitute>
</pathsubstitution>

The <to> section is the only line that ever changes since you will need to choose the protocol and path to your thumbs. If you want SMB, use "smb://<PATH>" for NFS it's "nfs://<PATH>" etc... In your sources you choose what protocol you want for the actual media files, but they do not need to be the same as the protocol used for the path substitution =)

Now... You just need to make sure you can make your NFS server work =)

Actually that is what I meant, it is not just replacing smb by nfs in the pathsubstitution line, what else do I have to do? Some config in my SynologyConfused? Any guide?
find quote
Ozymandyaz Offline
Member
Posts: 84
Joined: May 2011
Reputation: 0
Location: Toronto, ON
Post: #25
(2012-04-14 15:05)mcfreiz Wrote:  having problems finding/editing this file. anyone have detailed instructions on a synology dms 4

Hi mcfreiz -

It's no surprise that you cant find the file... Since it doesn't exist =)

Turns out that the my.cnf file is totally optional and you will need to create your own on the Synology. Fortunately, its super easy to do, here is how:

First, enable terminal in the Synology control panel 'Control Panel -> Terminal' by checking the 'Enable SSH Service' tick box.

Now, get an application like putty so that you can SSH to the Synology.

Start Putty and connect to the NAS. Login as root and use the same password that you set-up for your admin account (its actually the root account.)

Once in, type the following commands:

Code:
cp /usr/syno/mysql/share/mysql/my-small.cnf /etc/my.cnf
vi /etc/my.cnf

This will copy a sample cnf file to the proper location and then open it in the vi text editor.

Use the arrow keys to move down about a page and a half until you see the [mysqld] section. Get the cursor on the line that says "thread_stack = 128" and type the "i" key to enter the edit mode in VI.

Hit enter to make a new line and use an arrow key to get to that line. In the blank line add the text:
skip-name-resolve

Hit escape to exit edit mode, then type:
Code:
:wq
(that is colon, w, q, and then hit enter. The colon will start the command mode and wq will write and quit VI. Hitting enter will run the command and quit VI.

If you make a mistake and VI gets weird on you, hit escape, then :q! (colon, q, exclamation point, and Enter) This will exit VI without saving. VI can be quirky for the uninitiated...

Then you need to restart MySQL, type the following:

Code:
/usr/syno/etc/rc.d/S21mysql.sh restart

If you messed up, you will probably see an error while re-starting and MySQL will just ignore the cnf file =)

Guide for MySQL database using Synology NAS
http://youtu.be/3PmmDtK65ks

Silent AppleTV with Crystalbuntu
http://quixventure.com/2011/12/crystalbu...roduction/
(This post was last modified: 2012-04-14 20:21 by Ozymandyaz.)
find quote
Ozymandyaz Offline
Member
Posts: 84
Joined: May 2011
Reputation: 0
Location: Toronto, ON
Post: #26
(2012-04-14 19:56)jpcolin Wrote:  Actually that is what I meant, it is not just replacing smb by nfs in the pathsubstitution line, what else do I have to do? Some config in my SynologyConfused? Any guide?

HA NP! Here is the official XBMC Wiki entry for NFS, scroll to the bottom for Synology specific instructions. I actually have no idea if this is all necessary just for Thumbs, but I did it and it worked for me =)

http://wiki.xbmc.org/index.php?title=NFS

Guide for MySQL database using Synology NAS
http://youtu.be/3PmmDtK65ks

Silent AppleTV with Crystalbuntu
http://quixventure.com/2011/12/crystalbu...roduction/
find quote
zosky Offline
Donor
Posts: 304
Joined: Dec 2008
Reputation: 1
Location: toronto. canada
Post: #27
(2012-04-13 14:39)Ozymandyaz Wrote:  Ok, I see the issue, there are empty databases named xbmc_video and xbmc_music. In the past you needed to create those, but now it screws up XBMC... Go into phpmyadmin and delete those databases. You only want the ones that end with numbers to remain, I.e. xbmc_video60 and xbmc_music19.

ive had this running for a few years now with the mySQL db on a ubuntu-server and 2 xbmc's using nfs for the media + rSync for the cache. upgrading to eden was not clean... because the mySQL user didn't have access to create new databases, but once i got that sorted it migrated everything. ( dharma > rc2 > eden )

i have skip-name-resolve in my.cnf
i have entries in my /etc/hosts file on the server and clients
both installs browse the library just fine.
but updating is PAINFUL

rc2 made video58 and eden made video60
... i just dropped the 2 old ones,
but these didn't seem to be getting in my way.

xbmc still HANGS when i update the library (from either machine)
for 30 sec ... then it starts crawling through my directories

... clearly something is wrong with trying to update, but i don't get it
does anyone have a clue what's going on here Confused

box1; is ubuntu lucid minimal + xbmc eden
box2; is mint lisa (ubuntu onoric / kde) + xbmc eden

( this has been happening for a while, - dharma & eden-
... but i've been ignoring it, but its starting to gett on my nerves Confused )

eight xbmc devices mostly openElec
atom/ion | iphone4 | hpTouchPad | raspberryPI ...
central mySQL db ( +20TB NAS ) +maraschino +IRtoy.v2 +yatse
[Image: widget]
find quote
Memphiz Offline
Team-Kodi Developer
Posts: 10,974
Joined: Feb 2011
Reputation: 113
Location: germany
Post: #28
log file? (first link in my signature)

AppleTV2/iPhone/iPod: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for XBMC: Wiki NFS
HowTo configure avahi (zeroconf): Wiki Avahi
READ THE IOS FAQ!: iOS FAQ
find quote
rasta321 Offline
Junior Member
Posts: 1
Joined: Nov 2013
Reputation: 0
Post: #29
(2012-04-14 20:06)Ozymandyaz Wrote:  
(2012-04-14 15:05)mcfreiz Wrote:  having problems finding/editing this file. anyone have detailed instructions on a synology dms 4

Hi mcfreiz -

It's no surprise that you cant find the file... Since it doesn't exist =)

Turns out that the my.cnf file is totally optional and you will need to create your own on the Synology. Fortunately, its super easy to do, here is how:

First, enable terminal in the Synology control panel 'Control Panel -> Terminal' by checking the 'Enable SSH Service' tick box.

Now, get an application like putty so that you can SSH to the Synology.

Start Putty and connect to the NAS. Login as root and use the same password that you set-up for your admin account (its actually the root account.)

Once in, type the following commands:

Code:
cp /usr/syno/mysql/share/mysql/my-small.cnf /etc/my.cnf
vi /etc/my.cnf

This will copy a sample cnf file to the proper location and then open it in the vi text editor.

Use the arrow keys to move down about a page and a half until you see the [mysqld] section. Get the cursor on the line that says "thread_stack = 128" and type the "i" key to enter the edit mode in VI.

Hit enter to make a new line and use an arrow key to get to that line. In the blank line add the text:
skip-name-resolve

Hit escape to exit edit mode, then type:
Code:
:wq
(that is colon, w, q, and then hit enter. The colon will start the command mode and wq will write and quit VI. Hitting enter will run the command and quit VI.

If you make a mistake and VI gets weird on you, hit escape, then :q! (colon, q, exclamation point, and Enter) This will exit VI without saving. VI can be quirky for the uninitiated...

Then you need to restart MySQL, type the following:

Code:
/usr/syno/etc/rc.d/S21mysql.sh restart

If you messed up, you will probably see an error while re-starting and MySQL will just ignore the cnf file =)
you are my hero .. was about to give up and go back to running MySql from my destop because it was so slow loading the each page on ATV2. I am using SMB not NFS for thumbnails and it is now loading perfectly with this change ... THANK YOU SOO MUCH Big Grin
find quote
Ozymandyaz Offline
Member
Posts: 84
Joined: May 2011
Reputation: 0
Location: Toronto, ON
Post: #30
Hi all -

Anyone using a Synology NAS ought to also follow these instructions to make it so that the Synology can handle large databases... This was a big issue for me but was easily fixed:

http://forum.xbmc.org/showthread.php?tid=172788

Here is the text:

So... I seem to have fixed this issue by increasing the Thread_Stack from 128k to 256k in the MySQL my.conf file.

This was suggested by someone else having library issues with music and also using a Synology NAS. Looks to me like the default Synology settings are a little too conservative to run a big XBMC Library. Most things work, but I am guessing there is some recursive logic at the end of a clean up that updates episode counts and that can fail making the library basically functional, but not totally up to date.

Changing the settings made the library work going forward, but things that were already wrong continued to be wrong. That is to say, if an episode count was wrong, adding a show would increment it up and deleting a show would now increment it down, but it would always be off by however much it was in error prior to the fix... I fully resolved the issue by creating a new database and starting over. Now show counts are correct and I no longer have the MySQL error in the logs. AND... I think things are much faster...

So if you have a Synology NAS, you may want to to look at the /etc/my.conf file and change the value for Thread_Stack to 256k

You need to enable telnet and then SSH into the NAS using the login ROOT and whatever you set for your admin password. Only root can edit the file and save it. VI is the only installed text editor... so good luck!

Guide for MySQL database using Synology NAS
http://youtu.be/3PmmDtK65ks

Silent AppleTV with Crystalbuntu
http://quixventure.com/2011/12/crystalbu...roduction/
find quote