Tuesday, July 8, 2008

MySQL multi-core performance

According to MySQL, MySQL [5.0] "is fully multi-threaded, and will make use of multiple CPUs, provided that the operating system supports them".

However, there are different ways to use the extra CPUs. Does a single query from one connection use all CPUs (Parallelism) OR does it just distribute processing per connection? In the later option a single query wouldn't run any faster but multiple variations of the query could be run at the same time depending on the number of extra CPUs.

I'm using MySQL 5.0 and a forum poster claims 5.1 might have parallelism. Neither RHEL5 nor Hardy Heron have MySQL 5.1 packages.

In my search for this information I came across the blog of a Google employee (AFAICT) who is working on MySQL. He pointed out some things he doesn't like about parallelism and suggested other things MySQL users can do to get parallel features. I also came across a PostgreSQL vs MySQL benchmark which claimed that MySQL performance only improved 37% from quadrupling the cores while PostgreSQL improved over 200%. However they didn't specify what queries they ran (as mentioned above) to measure this.

No comments: