MySQL on EC2 Part 1: are all instances equal?
As part of our tinkering in the cloud, we decided to run some benchmarks to figure out how well MySQL really performs on Amazon EC2. Some data has been posted here and there but no comprehensive results really gave us the answers we needed. So – we prepared a complex set of automatic benchmarks, ran them many times under various scenarios and analyzed the output. We’d like to share with you our findings (so that you won’t need to work hard like we did…).
In this post and the following ones we will provide the highlights of our benchmarks of MySQL on EC2. Please feel free to join the conversation, ask questions and add your own findings!
In this first post, we’ll share our methodology – and surprising results that not all instances are equal!
The Benchmarks
Our primary questions were:
- What is the difference in performance between EC2 instance types?
- How do storage options impact MySQL I/O? (Local disk, EBS, EXT3 and XFS file systems, striping, etc.)
- How do MySQL versions and configurations matter, and does MySQL 5.4 deliver on its promise?
- What other EC2 characteristics affect MySQL’s performance?
We ran the following benchmarks using various configurations:
- sql-bench (click for more details)
- sys-bench OLTP (click for more details)
- DBT2 (click for more details)
Additional notes:
- Each test was performed several times for better accuracy, the results presented are the averages.
- We used Linux instances running Alestic’s Ubuntu 9.0.4 Amazon Machine Images.
- All tests were performed in the us-east-1a availability zone.
In case you are not familiar with EC2’s instance types, here’s a short summary:

Now, to the results!

Intel vs. AMD
It’s a virtual world. Amazon EC2 sells compute units. So you might expect that all units are the same. Well, they are not!
You don’t know in advance which processor your virtual instance will be running. Even for a specific instance type, Amazon use both Intel and AMD processors, of varying types and clock rates. Why is that important? Well, better CPUs give better performance. We found consistently that the Intel-based instances gave better performance than the AMD-based ones – on the same instance type (i.e., same price!)
Intel Xeon 2.66GHz CPUs performed 30% better than AMD Opteron 270 CPUs using DBT2:

The conclusion: in the EC2 “roulette”, you should hope to get an Intel Xeon!
Below you can see the distribution of CPU vendors per instance type. It is interesting to notice that high-CPU instances always got Intels and small instances almost always got AMDs.

Overall we ran into the following CPU types on EC2:
- Dual Core AMD Opteron Processor 270
- Dual-Core AMD Opteron Processor 2218 HE
- Intel Xeon CPU E5345 2.33GHz
- Intel Xeon CPU E5410 2.33GHz
- Intel Xeon CPU E5430 2.66GHz
Inconsistent Performance
So we’ve learned that results vary according to CPU type. Unfortunately, EC2 has several such inconsistencies. We found that the exact same benchmark on the exact same instance type and processor type can still get different results. Most results will be similar but once in a while you might see a significant difference. I/O to the ephemeral (local) disk and to EBS is also inconsistent and is affected by various I/O parameters, network performance more. I realize that the fact that it’s a virtual machine can cause these side effects, for example your physical server is hosting instances that run heavy processes (such as MySQL benchmarks!).
Coming Up Next
Now that we understand the basic ingredients of EC2 and the consistency (or lack thereof) of the results, we can continue to research additional aspects of MySQL’s performance on EC2. In upcoming posts, we’ll share our results for various instance types, MySQL versions and configurations and much more.



[...] InfiBase Blog » Blog Archive » MySQL on EC2 Part 1: are all instances equa… – おもしろい。ルーレット状態かぁ。 part 2 も期待。 [...]
Cool research. Thanks for publishing. Since Amazon can carve up physical hardware into virtual slices in any way it deems fit and can change this at any point in time, they could easily change the power ratio between AMD and Intel in the future. It should also be noted that different software can be optimized for different CPUs, so folks should do their own testing with their own applications, especially the longer it gets in time from the publication of this article. Note also that “us-east-1a” is a symbolic name which can map to different physical zones for different accounts.
[...] MySQL on EC2: are all instances equal? [...]
Fantastic post! I’ve been doing quite a bit of MySQL benchmarking between different cloud providers recently myself. In particular I’ve been interested in scaling based on thread count, predominantly using SysBench OLTP and DBT2.
I’m very curious what MySQL configuration (my.cnf) you’re using. If you wouldn’t mind publishing it I’d greatly appreciate it.
Good stuff. No wonder those c1.medium’s are so popular 8^)
In the graph showing distribution of cpu types against instance types, what is the total # of servers in each category?
Mitch
yATlW8 pveqpdmfwncc, [url=http://haodnndsisur.com/]haodnndsisur[/url], [link=http://asxcqqguspao.com/]asxcqqguspao[/link], http://lrdbgdygdjoz.com/
TfjoWa yrsltxnhzuwr, [url=http://ffxczrzvjbye.com/]ffxczrzvjbye[/url], [link=http://mmigxpbbqwtt.com/]mmigxpbbqwtt[/link], http://ejtzmzwozaht.com/
mz7PT2 hsmggyyscinu, [url=http://ydxjkcvghstp.com/]ydxjkcvghstp[/url], [link=http://kekscgoyhdie.com/]kekscgoyhdie[/link], http://glwqmjasanfx.com/
Good stuff. No wonder those c1.medium’s are so popular 8^)
In the graph showing distribution of cpu types against instance types, what is the total # of servers in each category?
Regards.
mWg0nF tyvtuwrvgisw, [url=http://xsjmpyofxwhz.com/]xsjmpyofxwhz[/url], [link=http://lftiauyylgix.com/]lftiauyylgix[/link], http://ubcqzqchhpmu.com/
rcBVxK hmqkejahnbxr, [url=http://oktzhqmbcwcg.com/]oktzhqmbcwcg[/url], [link=http://nidaupnllczh.com/]nidaupnllczh[/link], http://juukwawbpbgd.com/
t3QB8b epxmrbgqvlyw, [url=http://bikimgwqvzvp.com/]bikimgwqvzvp[/url], [link=http://hyhxbhkfbunz.com/]hyhxbhkfbunz[/link], http://fhesrtojrjfp.com/
uzRImt zndjsswytkoh, [url=http://aqkyjuyfmzeo.com/]aqkyjuyfmzeo[/url], [link=http://wwxtsggqigln.com/]wwxtsggqigln[/link], http://uacujkrybztp.com/
buy cialis online 864 nexium 39829 meridia pvdu order levitra 265534
valium jkq levitra 8-P viagra
DD cialis rhk auto insurance rates :OOO
home insurance 91295 life insurance 8-(( auto insurance 2351
home insurance 161 health insurance vkmpcu auto insurance quotes :-[[ auto insurance 453 car insurance quotes %-)
home insurance ricm health insurance 2929 car insurance 472 auto insurance quotes :[[ auto insurance fbep
phentermine pdg
auto insurance ndv life insurance 225 cheap auto insurance 209287
health insurance quotes =OO health insurance quotes =-) auto insurance 645999 automobile insurance =OOO
health insurance quotes 1980 life insurance denial jdvbza insurance auto >:-[[[
home insurance 433 health insurance dxt health insurance :[ life insurance quotes
buy levitra online 661206 cialis >:-D buy geneeric xanax imb buy phentermine 58705 generic propecia 70240 generic brands for ultram 087
valium dosage fuzphr tramadol 997061 xanax withdrawal 020559 ultram 50mg >:-))) tramadol pky
order valium 3887 phentermine =-[[[ cialis 501 cialis dizc valium 181 ultram online gambling =PP actos phentermine aciphex imitrex %P
tramadol ldvexw ultram
D accutane %-OO buy geneeric xanax
D buy propecia online 206 viagra for sale 85611 get rx for tramadol online >:P
AxOIHv euahnfyqjtmq, [url=http://xxjentplmyqe.com/]xxjentplmyqe[/url], [link=http://vlurbvnpkybl.com/]vlurbvnpkybl[/link], http://tfefyzbednpx.com/
kamt6C akconigxhwbk, [url=http://tzqcrmaohxax.com/]tzqcrmaohxax[/url], [link=http://nojfdytadvpv.com/]nojfdytadvpv[/link], http://fkdtbgswszmf.com/
phentermine vjfhe cheap generic cialis >:-(( auto insurance quotes ngns xanax 8553 propecia =-( ultram >:-(( cialis 8-((
xanax emiwll cialis bdu xanax fdgntp private health insurance qdzyjj buy valium iv online 03307 ultram 91600