Reputation: 59
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.
Upvotes: 1
Views: 2055
Reputation: 11832
If you're willing to take some overhead into account, you could try to start a virtual machine on the host, that is limited to 2 cpus/cores.
Upvotes: 1
Reputation: 13427
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.
Upvotes: 1