On Thu, Dec 26, 2002 at 12:17:28PM -0700, Matt Sturtz wrote:
> 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...
> 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)
> 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
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)