Wednesday, March 2, 2011

Which is faster Windows Hyper-V or VMWare ESX?

Catchy title and I am sure you want to know the simple answer - Hyper-V or ESX.  The challenge is the answer is not so simple.  This blog will help you understand why the answer is not so simple and should help you in asking some questions when trying to decide.

Before I go too far I should let you know I am definitely biased toward Hyper-V after being the Performance Lead for three releases.  You can check out my Hyper-V only blog on http://blogs.msdn.com/tvoellm.  However now that I am no longer with Microsoft I'll do my best to give some good balanced insights.

While ESX has been around longer than Hyper-V I dont think you should use this to determine how fast for functional one is over the other.  For example is MySpace better than Facebook?  What you will likely see from a more mature product will be higher reliability just because the engineers for the mature product has had more time to shake out bugs.  I can't really speak to ESX reliability however I can save Hyper-V runs on everything from 1 processor up to 64 processors and we literally tested it day and night for thousands of hours of up time fault free.  I think it is more than ready for your mission critical applications.

Now back to performance.  First you need to understand there are a couple of types of virtualization.  You can get all the details on http://en.wikipedia.org/wiki/Virtualization however for purposes of this article you just need to understand Hyper-V and ESX virtualize the CPU, network, storage, and graphics using hardware support, emulation and binary patching.  Hardware support means hardware vendors like Intel/AMD have added capabilities to their hardware that allows certain operations like page resolution or packet routing to a Virtual Machine (VM) to be done in hardware (hardware helps because it does not require expensive switches into the hypervisor).  Emulation means the CPU/etc instructions to be executed are being emulated in software rather than running on real hardware (you might wonder how this can be faster - it can be when there is a lot of events in the hardware that keep engaging the hypervisors).  Last there is binary patching where the original software being run in a VM is changed in some why - only ESX does this (binary patching is a useful technique because it allows for more direct control of what a piece of software - the virtualized operating system in this case - should do rather ahead of time rather than trying to determine it when an event happens).

Now that you have the basics of vitualization you can begin to understand some of the questions to ask and you might also realize that there is a lot more than the Hyper-V and ESX bits that determine how performant your virtualized workloads will be.

Really there is more than just Hyper-V and ESX to worry about?  Yes.  For example Hyper-V and ESX both support special instructions in the CPU's to support things like second-level address translation, etc however that does not mean the CPU you have supports that function.  For example CPU's that are three years old likely do not support second level address translation which is a key feature to making VM's run fast expecially VM's running memory intensive operations.  So the first question you should ask when looking to virtualize is "What machine should I buy and in particular what CPU does it have?".  The simple answer is to look for a Intel Nehalem based processor such as the Xeon 5500+ or Core i7+ and for AMD look for recent Opteron or Phenom II processors. You can see more on Intel virtualization here and AMD virutalization here.  I can't stress enough how much the CPU virtualization features have an impact.  Both Hyper-V and ESX make good use of the CPU features and none really has an advantage over the other.  Choose your CPU with the workload you want to run in mind.

This leads us to question #2 - What do the workloads look like that you are planning to run?  The reason the workload matters so much is how Hyper-V and ESX virtualize networking and storage.  In for example if you have a fully cached web server you want to run in a virtual machine its very likely that Hyper-V will run better because its networking virtualization is better although ESX is catching up.   If however if you are running a database it may be ESX will be better because it has more support from big hardware vendors like EMC and NetApp to improve storage performance.  As for 3D graphics I dont have a clear winner for you.   If you are a Microsoft shop mostly you should go with Hyper-V because of the deep integration with Terminal Services.  Your workloads is largely determined on how it uses the network, storage and graphics primarily.   More use more a more intensive workload.  For example databases are storage intensive, web servers are generally network intensive, and simulations like Weather modeling are CPU and Graphics intensive.

So on to question #3 - What is your storage environment?  The environment not only includes the host machine where the virtual machines will be running but also the storage infrastructure.  For example will you be running a SAN or iSCSI storage network?  If you want iSCSI to a VM then Hyper-V will likely be better because its networking performance is better overall however if you run a SAN than ESX might be the better choice.  There are also other questions to ask around storage like LUN provisioning, snapshotting, and migration (moving storage between host machines).  The deeper the level on integration of the solution the more performant it is likely to be.  Hyper-v has great basic I/O performance however I've seen more integration of VMWare with storage solutions.

Given we touched on storage we need to cover the importance of networking.   It would be worth asking what virtualization networking features does your NIC support? Believe it or not Intel and Broadcom have both adopted certain features like VMQ (aka Netqueue), TCP offload (checksum and large send), Jumbo Frames, and RDMA.  Hyper-V has traditionally been ahead here but there has been some leap frogging.

Another important performance dimension is power so the question is what power management features does your virtualization solution support?  This is important because lots of power use means lots of heat and lots of heat means lots of cost for cooling.  Both Hyper-V and ESX have power management features however at the time of this article VMWare is a bit ahead on this front.  Overall virtualization with either solution will save power because of true hardware to virtual machine consolidation.  What I am taking about is once you have virtualized which solution will use less power per VM operation.  They are both very competitive here.

Last but not least what virtualization features do Hyper-V and VMWare support.  For Hyper-V you can see here and for ESX see here.

So to recap the questions:

#1 - What machine should I buy and in particular what CPU does it have?  Intel here and AMD here
#2 - What do the workloads look like that you are planning to run?
#3 - What is your storage environment?  Check out the NetApp and EMC sites.
#4 - What virtualization networking features does your NIC support?
#5 - What power management features does your virtualization solution support?

There are many many more questions you could ask however the real purpose of this article was to help you understand that asking "Which is faster Windows Hyper-V or VMWare ESX?" is not such an easy question to answer and to arm you with some question you should ask.

In the end my recommendation is to try before you buy.  You can ask all the questions you want however in the end you need to make a decision. My suggestion is to borrow an environment if you can and try your workloads on it.  Whichever is better for you go for it (PS.... dont forget the cost).

  Tony Voellm