Optimizing for Virtualization
- Posted in
- IT Computing
Limitations to Keep in Mind When Virtualizing
Keeping the Monitor and VMkernel's tasks in mind, which aspects of your application are the most easily affected by virtualization?
As it stands, VMware sees about an 80/19/1 division in application performance profiles. To put this more clearly, they estimate that 80% of all applications will notice very little to no performance impact from being virtualized, 19% will experience a noticeable performance hit, while 1% is deemed completely unfit for virtualization.
These numbers don't say a whole lot for your application, though, so here is a listing of parameters VMware looks for:
CPU usage. Just by looking at your task manager (or whichever monitoring tool you prefer), you can make a reasonable guess at what will happen when you virtualize. If you're seeing generally high CPU usage with very little kernel time, and you're generally not too worried about I/O, your application has a good chance of running fine in a virtual environment. Why is that?
User-mode CPU instructions can generally be run without any additional overhead. The Monitor is able to simply let these pass through to the CPU scheduler, because there's no danger in these instructions causing a mess for the other VMs. The dangerous instructions are the ones that require kernel mode to kick in, usually because the Operating System in question is not aware of its virtualized state, and could prevent the other VMs from functioning properly. Different solutions have been developed to work around this, but it's important to realize which type is used in which situation.
Luckily, for ESX 4 Scott Drummonds provided a nice overview of which combinations are used in every situation, allowing us to check and make sure our VMs are using the best our hardware has to offer.
| AMD Virtualization Tech Use Summary | |||
| Configuration | Barcelona, Phenom and Newer | AMD64 Pre-Barcelona | No AMD64 |
| Fault Tolerance Enabled | AMD-V + SPT | Won't run | Won't run |
| 64-bit guests | AMD-V + RVI | BT + SPT | Won't run |
| VMI Enabled | BT + SPT | BT + SPT | BT + SPT |
| OpenServer, UnixWare, OS/2 | AMD-V + RVI | BT + SPT | BT + SPT |
| 32-bit Linux and 32-bit FreeBSD | AMD-V + RVI | BT + SPT | BT + SPT |
| 32-bit Windows XP, Windows Vista, Windows Server 2003, Windows Server 2008 | AMD-V + RVI | BT + SPT | BT + SPT |
| Windows 2000, Windows NT, DOS, Windows 95, Windows 98, Netware, 32-bit Solaris | BT + SPT | BT + SPT | BT + SPT |
| 32-bit guests | AMD-V + RVI | BT + SPT | BT + SPT |
| Intel Virtualization Tech Use Summary | |||||||
| Configuration | Core i7 | 45nm Core 2 VT-x | 65nm Core 2 VT-x Flex Priority | 65nm Core 2 VT-x No Flex Priority | P4 VT-x | EM64T No VT-x |
No EM64T |
| Fault Tolerance Enabled | VT-x + SPT | VT-x + SPT | VT-x + SPT | VT-x + SPT | Won't run | Won't run | Won't run |
| 64-bit guests | VT-x + EPT | VT-x + SPT | VT-x + SPT | VT-x + SPT | VT-x + SPT | Won't run | Won't run |
| VMI Enabled | BT + SPT | BT + SPT | BT + SPT | BT + SPT | BT + SPT | BT + SPT | BT + SPT |
| OpenServer, UnixWare, OS/2 | VT-x + EPT | VT-x + SPT | VT-x + SPT | VT-x + SPT | VT-x + SPT | BT + SPT | BT + SPT |
| 32-bit Linux and 32-bit FreeBSD | VT-x + EPT | VT-x + SPT | BT + SPT (*) | BT + SPT (*) | BT + SPT (*) | BT + SPT | BT + SPT |
| 32-bit Windows XP, Windows Vista, Windows Server 2003, Windows Server 2008 | VT-x + EPT | VT-x + SPT | VT-x + SPT | BT + SPT (*) | BT + SPT (*) | BT + SPT | BT + SPT |
| Windows 2000, Windows NT, DOS, Windows 95, Windows 98, Netware, 32-bit Solaris | BT + SPT (*) | BT + SPT (*) | BT + SPT (*) | BT + SPT (*) | BT + SPT (*) | BT + SPT | BT + SPT |
| 32-bit guests | VT-x + EPT | VT-x + SPT | VT-x + SPT | VT-x + SPT | VT-x + SPT | BT + SPT | BT + SPT |
(*) denotes the capability of dynamically switching to VT-x mode when the guest requires it.
For more information on Shadow Page Tables (SPT), Extended Page Tables (EPT), RVI (Rapid Virtualization Indexing), Intel Hardware Virtualization (Intel VT-x) and AMD Hardware Virtualization (AMD-V), refer to our previous articles on these subjects.
Network bandwidth: To VMware, bandwidth is the biggest reason why an application could prove troublesome when virtualized. The theoretical amount of throughput ESX can maintain is claimed to be about 16Gbps. Adding in a big dash of realism, VMware places applications with a requirement for over 1Gbps in the "troublesome" category: Virtualization is possible, but they don't rule out that there might be a performance hit. What we have noticed ourselves here is a great amount of CPU overhead on the side of the initiator when teaming up multiple NICs to increase bandwidth. Teaming up to three Gigabit switches together causes a CPU load of about 40% inside a Windows Server 2003 VM running on four vCPUs of a 2.93GHz Nehalem processor. This overhead is greatly reduced when updating to Windows 2008 (to about 15%), and is further reduced to less than 5% when using ESX's own iSCSI initiator. Much thanks to Tijl Deneut of the Sizing Servers Lab for this tip.
General I/O: This is the one thing VMware will admit to causing a few applications to be simply "unvirtualizable". ESX at this point can maintain roughly 100,000 IOPS (vSphere is rumored to push this up to 350,000) and a maximum of 600 disks, which is a relatively impressive number considering a hefty Exchange installation requires something to the tune of 5000 IOPS. Counting at roughly 0.3 IOPS per user, that would account for over 16000 users, though of course this number might vary depending on the setup and user profiles. However, there are applications that simply require more IOPS, and they'll experience quite a lot of trouble under ESX. Moreover, changes in the storage layout might turn up some unexpected results, but we'll have more on that in the second article for this series.
Memory requirements: Finally, for very large database systems, there might be an issue here. In ESX 3.5, it is only possible to allocate as much as 64GB of RAM to a single VM. While plenty for most deployments, this might make virtualization of large-scale database systems troublesome. Should this be the case, remember that ESX 4.0 ups this limit to 255GB per VM, allowing even the most memory-hungry databases an impressive amount of leeway.
Keeping these things in mind, however, there are some ways to get the most of your virtualized environment….
Originally published at https://www.anandtech.com/show/2786 (Wayback Machine).