views:

24

answers:

2

I have a web application that seems to like to make mysql work hard (cpu wise), as a result i want to establish how the performance of our application scales as we transition to more modern hardware, the current system has 2 cpu, and we could move it onto a grid system, but to find out if this is worthwhile i want to benchmark our application on a linux machine i have available with 4 cores, is it possible to limit mysql to use on a certain number of cores? and if so how do i do this?

thanks for any help.

A: 

taskset

I'm not aware of any setting in MySQL itself which can do this,

Wrikken
A: 

Sort of. If you are using innoDB as your main storage engine, there is a configuration option called thread_currency that you set in my.cnf that is suggested to be set at 2x the number of CPUs you have.

If you're using MyISAM mainly, then no.

In either case, if you haven't already enabled the mysql slow query log ( http://dev.mysql.com/doc/refman/4.1/en/slow-query-log.html ) on that machine, and haven't tried EXPLAINing ( http://dev.mysql.com/doc/refman/5.0/en/explain.html ) all your select queries, do that first, as hardware may not be your problem.

Mike Sherov
Thanks, I know there are problems with the SQL, but wanted to check the hardware first as our isp can give us more hardware more cheaply than our developer works for.
joe Lovick
@joe, all it takes is one unoptimized query to take even a server with twice the power and CPU's to it's knees. I understand that developer time is more expensive than hardware, but RDBMS scaling is not something that is easily fixed with more hardware.
Mike Sherov