List:General Discussion« Previous MessageNext Message »
From:Jeremy Zawodny Date:December 26 2002 11:02pm
Subject:Re: Replication priority / speed
View as plain text  
On Thu, Dec 26, 2002 at 12:17:28PM -0700, Matt Sturtz wrote:
> Hello,
> 
> We run several frontend servers (Linux/Apache/PHP) behind a load
> balancer.  Each frontend is also a MySQL slave, and all queries are
> done locally (all changes go directly to the master).  The problem
> is, whenever somebody makes a lot of changes to the database at once
> (deletes, updates, or adds a lot of rows), the slave thread loads up
> the server to the point where Apache doesn't get much CPU anymore,
> and then our sites slow way down...

Hmm.

> Is it possible to set either set the priority ('nice') of the Slave
> thread down so it doesn't do that?

The slave thread only?  No, not really.  You could nice MySQL when you
start it up.  But I'm not sure how much effect (positive or negative)
that'd have.

> Or, alternatly, is there a way to limit the slave thread to only "X"
> bin-log transactions per second?

There is not.

As a gross hack, you could monitor the speed closely and use a lot of
"SLAVE STOP" and "SLAVE START" commands to throttle it.  But that's
really quite ugly.

Are your updates already well optimized?  If you're doing enough work
to cause noticeable speed problems, I'd double-check that if you
haven't already.

Jeremy
-- 
Jeremy D. Zawodny     |  Perl, Web, MySQL, Linux Magazine, Yahoo!
<Jeremy@stripped>  |  http://jeremy.zawodny.com/

MySQL 3.23.51: up 11 days, processed 442,093,184 queries (435/sec. avg)
Thread
Replication priority / speedMatt Sturtz26 Dec
  • Re: Replication priority / speedJeremy Zawodny27 Dec
    • Re: Replication priority / speedMatt Sturtz30 Dec
      • Re: Replication priority / speedJeremy Zawodny30 Dec
      • Re: Replication priority / speedDan Nelson30 Dec
        • Re: Replication priority / speedJeremy Zawodny30 Dec
  • Re: Replication priority / speedSimon K. Grabowski30 Dec
    • Re: Replication priority / speedMatt Sturtz31 Dec
  • Re: Replication priority / speedSimon Grabowski1 Jan