For a long time I’ve wanted to know how MySQL scales as you add more memory to the server. Vadim recently benchmarked the effects of increasing memory and CPU core count. He looked for a balance between utilizing the hardware as much as possible, limiting the system complexity, and lowering the price-to-performance ratio.
The outcome of the research, which was sponsored by Virident, is that as you add CPUs and increase memory size, MySQL doesn’t scale as well as we would like, and solid-state storage — specifically, the Virident tachIOn drive — has more bandwidth than MySQL can fully utilize at present. Therefore, to decrease the price-to-performance ratio and increase the utilization of the tachIOn drive, Vadim sharded the database into smaller instances and colocated them on the same machine. It’s not a new approach, but to date I’m not aware of anyone measuring the different configurations the way Vadim has done.
You can read the full details in our Scaling MySQL With Virident Flash Drives and Multiple Instances of Percona Server white paper.
I should clarify that I too think that throwing many instances on a box is not the way to scale..
However, I’d also say from experience that the challenge of running two instances on a machine are just the same as 32..
Mark, I was very conscious of that earlier work while writing up these results. I think there are a couple of crucial differences, and I have not changed my mind about the earlier benchmarks. They were artificially throttled to show “linear” scaling, they did not actually examine the scalability tradeoffs the way Vadim has done, and like Peter said, determining that 2 instances is a sweet spot is a far cry from just throwing 32 instances on the box. Finally, these 2 instances are providing high performance, not just massive parallelism — there is a big difference, and when latency matters, “many slow queries all at once” is not acceptable.
Mark,
I still would state what running many instances of MySQL on the same box is a pain and it is much better if you can get to use full box resources with only single instance.
The other thing there is the difference between running 2 instances (which is there main advantage comes) and running 32 instances as the blogger in original article advices.
Interesting reading!
I’ll note, we did similar stuff back in 2008 when originally joining Sun, which you guys were pretty critical of:
http://www.mysqlperformanceblog.com/2008/11/11/scaling-to-256-way-the-sun-way/
Slightly different scalability bottlenecks discussed, but both falling back to the good old “oh just run more of them on the same machine”..