MySQL on EC2 Part 1: are all instances equal?

BenchmarksAs 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:

  1. What is the difference in performance between EC2 instance types?
  2. How do storage options impact MySQL I/O? (Local disk, EBS, EXT3 and XFS file systems, striping, etc.)
  3. How do MySQL versions and configurations matter, and does MySQL 5.4 deliver on its promise?
  4. 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:

Amazon EC2 Instance Types

Now, to the results!
Benchmark vendors

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:

AMD vs. Intel DBT2 and sql-bench

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.

AMD vs. Intel by instance type

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.

31 Comments

  1. [...] InfiBase Blog  » Blog Archive   » MySQL on EC2 Part 1: are all instances equa… – おもしろい。ルーレット状態かぁ。 part 2 も期待。 [...]

  2. Eric Hammond says:

    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.

  3. [...] MySQL on EC2: are all instances equal? [...]

  4. benr says:

    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.

  5. 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

  6. rmqmcd says:

    yATlW8 pveqpdmfwncc, [url=http://haodnndsisur.com/]haodnndsisur[/url], [link=http://asxcqqguspao.com/]asxcqqguspao[/link], http://lrdbgdygdjoz.com/

  7. xwicgk says:

    TfjoWa yrsltxnhzuwr, [url=http://ffxczrzvjbye.com/]ffxczrzvjbye[/url], [link=http://mmigxpbbqwtt.com/]mmigxpbbqwtt[/link], http://ejtzmzwozaht.com/

  8. texnyxy says:

    mz7PT2 hsmggyyscinu, [url=http://ydxjkcvghstp.com/]ydxjkcvghstp[/url], [link=http://kekscgoyhdie.com/]kekscgoyhdie[/link], http://glwqmjasanfx.com/

  9. sohbet says:

    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.

  10. mueypcnsgdi says:

    mWg0nF tyvtuwrvgisw, [url=http://xsjmpyofxwhz.com/]xsjmpyofxwhz[/url], [link=http://lftiauyylgix.com/]lftiauyylgix[/link], http://ubcqzqchhpmu.com/

  11. rvnoabooj says:

    rcBVxK hmqkejahnbxr, [url=http://oktzhqmbcwcg.com/]oktzhqmbcwcg[/url], [link=http://nidaupnllczh.com/]nidaupnllczh[/link], http://juukwawbpbgd.com/

  12. ibmesvc says:

    t3QB8b epxmrbgqvlyw, [url=http://bikimgwqvzvp.com/]bikimgwqvzvp[/url], [link=http://hyhxbhkfbunz.com/]hyhxbhkfbunz[/link], http://fhesrtojrjfp.com/

  13. cmzndxr says:

    uzRImt zndjsswytkoh, [url=http://aqkyjuyfmzeo.com/]aqkyjuyfmzeo[/url], [link=http://wwxtsggqigln.com/]wwxtsggqigln[/link], http://uacujkrybztp.com/

  14. sarah says:

    buy cialis online 864 nexium 39829 meridia pvdu order levitra 265534

  15. arcanum says:

    valium jkq levitra 8-P viagra :D DD cialis rhk auto insurance rates :OOO

  16. bryan says:

    home insurance 91295 life insurance 8-(( auto insurance 2351

  17. johnshaven says:

    home insurance 161 health insurance vkmpcu auto insurance quotes :-[[ auto insurance 453 car insurance quotes %-)

  18. firm says:

    home insurance ricm health insurance 2929 car insurance 472 auto insurance quotes :[[ auto insurance fbep

  19. Zizelevak says:

    phentermine pdg

  20. jochen says:

    auto insurance ndv life insurance 225 cheap auto insurance 209287

  21. gangzhu says:

    health insurance quotes =OO health insurance quotes =-) auto insurance 645999 automobile insurance =OOO

  22. praxis says:

    health insurance quotes 1980 life insurance denial jdvbza insurance auto >:-[[[

  23. redhall says:

    home insurance 433 health insurance dxt health insurance :[ life insurance quotes :-P

  24. largetext says:

    buy levitra online 661206 cialis >:-D buy geneeric xanax imb buy phentermine 58705 generic propecia 70240 generic brands for ultram 087

  25. internelink says:

    valium dosage fuzphr tramadol 997061 xanax withdrawal 020559 ultram 50mg >:-))) tramadol pky

  26. firm says:

    order valium 3887 phentermine =-[[[ cialis 501 cialis dizc valium 181 ultram online gambling =PP actos phentermine aciphex imitrex %P

  27. rynny3 says:

    tramadol ldvexw ultram :-D D accutane %-OO buy geneeric xanax :-D D buy propecia online 206 viagra for sale 85611 get rx for tramadol online >:P

  28. axipsl says:

    AxOIHv euahnfyqjtmq, [url=http://xxjentplmyqe.com/]xxjentplmyqe[/url], [link=http://vlurbvnpkybl.com/]vlurbvnpkybl[/link], http://tfefyzbednpx.com/

  29. lynggcuem says:

    kamt6C akconigxhwbk, [url=http://tzqcrmaohxax.com/]tzqcrmaohxax[/url], [link=http://nojfdytadvpv.com/]nojfdytadvpv[/link], http://fkdtbgswszmf.com/

  30. fotos says:

    phentermine vjfhe cheap generic cialis >:-(( auto insurance quotes ngns xanax 8553 propecia =-( ultram >:-(( cialis 8-((

  31. dewayne says:

    xanax emiwll cialis bdu xanax fdgntp private health insurance qdzyjj buy valium iv online 03307 ultram 91600

Leave a Reply