I’ve been involved in a few scenarios recently where “a virtual machine isn’t performing as well as it was on physical” and virtualization was blamed.
So where should one start troubleshooting this?
In this case we’re comparing an application on a physical host to the same application within a VM. Some simple, but often overlooked, questions should be:
1) Are both hosts the same hardware and configuration?
More often than not, I find that people are comparing performance of two different platforms or configurations. While servers may have the same model number, important differences “sneak in” like processor models, clock speeds, physical memory balance/speed and BIOS settings. One cannot make a fair comparison unless the same foundation is used. An easy way to eliminate this confusion is to use the same host both with/without a hypervisor.
2) Is the VM configured the same as the physical host?
This really seems silly but I see different configurations quite regularly. Example: a physical platform has two processor sockets and 4 cores per processor but the VM is configured with only 4 vCPUs. This cannot be compared directly, nor can it be compared lineally (eg: 50% of the sockets doesn’t equal 50% of the performance). Same considerations for memory. A change in memory allocation, either increase or decrease, can change the way an operating system or application performs.
3) Is the storage the same?
Storage is the most common performance issue I diagnose. This one is a little more complex but extremely important. If the storage is not identical between tests, it will invalidate any comparison. You must use the same type of storage (local, SAN, NAS), same protocol (iSCSI, FC or NFS), same disk type (SAS, SATA, FC) and even same spindle speed. The best comparison is done using the same LUNs if possible, switched between physical and virtual guests. Small IO latency changes can account for large performance swings so even the simple things like using local disk but changing the RAID type, introduce discrepancy.
If you ever look at true benchmarks, like VMmark, that’s why the process and method is very prescribed and audited. It leaves little flexibility to make sure the highest quality comparison and results. They do need more effort but that’s the price of accuracy.
So if you’re asked to do a comparison, or find yourself troubleshooting why performance has changed, ask the simple question first: “Is this apples to apples?” Better to be fair and meticulous whether the results are good or bad.
I challenge you to make the comparison as close as possible. If you have any questions, please feel free to ask.
