dannyman.toldme.com

About Me : Free Style : Good Reads : News and Reaction : Photographs : Technical : Travels : Unsorted

Search:
October 3, 2007
Technical

MySQL Slave Database Can’t Catch Up

I’ve got a MySQL slave server, and Seconds_Behind_Master keeps climbing. I repaired some disk issues on the server, but the replication lag keeps increasing and increasing. A colleague explained that several times now he has seen a slave get so far behind that it is completely incapable of catching up, at which point the only solution is to reload the data from the master and re-start sync from there. This isn’t so bad if you have access to the innobackup tool.

The server is only lightly loaded. I like to think I could hit some turbo button and tell the slave to pull out all the stops and just churn through the replication log and catch up. So far, I have some advice:

1) Eric Bergen explains that the reason it keeps falling further behind is because the slave server can only process queries sequentially, whereas the master database processes queries in parallel.

2) MySQL suggest that you can improve performance by using MyISAM tables on the slave, which doesn’t need transactional capability. But I don’t think that will serve you well if the slave is intended as a failover service.

Xaprb explains this well, then goes on to say:

Your options are fairly limited. You can monitor how far behind the slave is . . . and assign less work to it when it starts to lag the master a lot . . . You can make the slave’s hardware more powerful . . . If you have the coding kung-fu, you might also try to “pipeline the relay log.”

That pipeline approach sounds like the YouTube way.

Update: to my surprise, things got better!

Read More

Next: MySQL Database Slave Did Catch Up!
Previous: Myanmar Turns Grisly
Categories: Technical
Possibly-Related Posts
MySQL Database Slave Did Catch Up!
blog-to-nntp
Windows File Synchronization
Newbie Mac Hobo
MySQL: Backup User Privileges
FreeBSD: Overriding the System Timezone
.exrc

Response

October 4th, 2007

Ji Village News

Good to know. Thanks Danny!

Comment / Tip

. . . or leave a Tip

Leave a comment . . .

  1. For private messages, e-mail me: dannyman@toldme.com
  2. I will not publish or share your e-mail address.
  3. I will not spam you.
  4. Therefor: no anonymous posts; send me your e-mail address!
(required)
(required)

. . . comments from new posters will be held for screening.

Danny Howard is 100% responsible for the content on this site, except some of it is stolen.

All rights are reserved, unless otherwise noted. Generally, I'm a BSD guy, so you can assume implicit permission to adapt, modify, and redistribute my intellectual property with appropriate attribution. Except some of this content is itself re-appropriated, so you'd best ask first, especially for commercial use. Thanks!

You can contact me via e-mail: dannyman@toldme.com

Most of http://dannyman.toldme.com/ is powered by WordPress.

If you're hip to RSS and whatnot, you can subscribe to this site.

These links are for dannyman: login AND backlinks