MySQL Forums
Forum List  »  Performance

Re: Higher priority for slave thread possible?
Posted by: James Day
Date: November 22, 2005 10:11PM

Often requested but not possible. Your practical options at present are limited to optimising or adding more slaves.

You might try running OPTIMIZE TABLE on key tables at a low load time. Usually it's possible to do that on each slave individually without causing the master and slave to become inconsistent. In rare cases it can do things like affect the order in which records are added from queries like INSERT ... SELECT because the optimiser might choose a different processing order. If the added records have new autoincrement keys those can then be different on master and slave.

For this reason the safe way to do it is OPTIMIZE TABLE on the master and letting it replicate to all slaves at the same time, which will often have the effect of a denial of service attack on your servers.

It's also possible to have your application check and send queries to the least lagged slave. Or you could temporarily switch the application away from a slave to give it time to catch up, possibly cycling this through the set.

Longer term it's expected that row-based replication and the possibility of having more than one SQL thread will assist with this sort of situation. However, in chronic overload situations, you're still going to need to do something about that.

James Day
Support engineer, MySQL AB

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Higher priority for slave thread possible?
1788
November 22, 2005 10:11PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.