Hyper-V and Multiprocessor VMs

Published 29 February 08 01:43 AM | winsrvperf 

Thanks for visiting our blog! I’m a development lead in the Windows Server Performance team and I led the performance effort on Hyper-V for Windows Server 2008 over the past three and a half years.

 

We’ve worked with the product team throughout the Hyper-V development cycle to deliver a competitive product and we’re excited about shipping Hyper-V RTM this year, with the Hyper-V Beta shipping in Windows Server 2008 this week!

 

Architectural Overview

 

Hyper-V ArchitectureHyper-V uses a hypervisor-based architecture and leverages the driver model of Windows for broad hardware support. The hypervisor partitions a server into containers of CPU and memory. As a micro-kernel, it provides mechanisms for inter-partition communication upon which our new high-performance synthetic I/O architecture is built. The root partition owns physical I/O devices and provides services including I/O implemented by the virtualization stack to the child partitions.

 

The virtualization stack implements emulated I/O devices such as an IDE controller and a DEC 21140A network adapter. However, it is expensive to virtualize such devices. Sending a single I/O might require multiple trips between the virtualization stack and child partition. Instead, Hyper-V exposes synthetic I/O devices that are specially designed for VM environments. These devices are attached to VMBus, which is a plug-and-play capable bus that uses shared memory for efficient inter-partition communication. The Windows guests detect the devices on VMBus and loads the appropriate drivers.

 

Hyper-V Synthetic IOSynthetic I/O in Hyper-V uses a client-server architecture with Virtualization Service Providers (VSPs) in the root and Virtualization Service Clients (VSCs) in the child. This architecture significantly reduces the cost of sending an I/O. Virtual Server customers should observe a major reduction in CPU usage in I/O-intensive loads when they migrate their VMs to Hyper-V.

 

In addition, we developed operating system enlightenments for Windows Server 2008, which make the NT kernel and memory manager smarter in VM environments, again to reduce the cost of virtualization.

 

Multi-Processor Guests

 

For this first blog post, I want to highlight one of the major performance features in Hyper-V: multi-processor virtual machines. Hyper-V supports 4P VMs for Windows Server 2008 guests and 2P VMs for Windows Server 2003 SP2 guests. For more intensive server workloads, you might consider virtualizing them in 2P or 4P VMs on Hyper-V. Of course, you should use multi-processor VMs only if the workload requires it since there is some cost to having additional processors.

 

However, operating system kernels and drivers use spin locks which do not block and spin until the lock is acquired, with the assumption that the lock is held for a short period. Virtualization breaks this assumption as virtual processors (VPs) are time-sliced. If a VP is preempted while holding a spin lock, other VPs may spin for a long time wasting CPU cycles.

 

We developed innovations in the hypervisor and Windows Server 2008 kernel to try to prevent long spin wait conditions and also to efficiently detect and handle them when they do occur. We also designed the hypervisor, including the scheduler and memory virtualization logic, to be lock-free on most critical paths to ensure good scalability on multi-processor systems.

 

As a result, Windows Server 2008 as a 4P guest scales well compared to the physical 4P system. This is one example of Windows Server 2008 as a guest and Hyper-V together providing performance advantages. We plan to continue to improving our scalability on multi-processor systems and multi-processor VMs in subsequent releases.

 

Closing Thoughts

 

Thanks for reading this far! I would encourage you to try Hyper-V Beta in Windows Server 2008, which launched this week. And take a look at the Windows Server 2008 and Virtualization web site for more information.

 

I look forward to writing more on our work on Hyper-V performance. Please add our blog to your RSS feeds!

 

Regards,

 

John Sheu

Senior Development Lead

Windows Server Performance Team

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Michael said on April 4, 2008 1:05 PM:

Are there any advantages/disadvantages to configuring a Guest with more Virtual Processors then are physically present on the Host?  (for example, a 4P Guest running on a 2P Host?)

John: The number of virtual processors cannot exceed the number of physical processors in Hyper-V. Most operating systems are designed to expect that all of their processors are running at the same time, so having more virtual processors than physical processors would likely result in poor performance.

# Rekha said on May 8, 2008 12:45 AM:

How many VMs does hyper-v support?

John: There is no hard-coded limitation. You should plan the capacity of the virtualization server based on its CPU, RAM, and I/O resources and the expected and peak loads on the VMs.

# James said on June 25, 2008 7:42 AM:

What is the maximum number of virtual processors that the root partition can have?  

or does the root partition Windows 2008 OS have acess to all available CPUs in the box (via the hypervisor layer)

Is this configurable ?

Thanks

 --

Thanks for your question James.

 

The root partition always has access to the same number of virtual processors as logical processors present on the machine.  Each root virtual processor is affinitized to each logical processor. 

 

Currently Windows Server 2008 Hyper-V officially supports up to 16 logical processors.

 

Tim Litton, Program Manager, Windows Server Performance.

# Andy said on September 18, 2008 12:12 PM:

Are there any setting that can throttle CPU for the VMs so that overall host hyper-v cpu doesn't go to 100%?

---

Andy, yes it is possible to throttle the maximum CPU resources that an individual virtual machine gets.

 

Under the settings for a virtual machine, select the “Processor” category and within the “Resource Control” section it is possible to set the limit on the amount of virtual CPU that can be allocated to this machine, as a percentage of the CPU resources available to this virtual machine.  This limit setting applies regardless of whether or not other virtual machines running.

 

If you want to ensure that the host CPU resources aren’t completely consumed, then you will need to ensure that sum of the limit settings of all the running virtual machines does not exceed 100%.

 

However remember that server virtualization is about consolidating workloads of underutilized machines onto a smaller number of better utilized machines, so over committing on the virtual CPU is something that Hyper-V was designed to do.

 

Tim Litton, Program Manager, Windows Server Performance. 

 

# Doug White said on October 1, 2008 9:20 PM:

Any tweaks for going over 4 cores?  I'd like to virtualize a Ubuntu-based app that requires as many cores and as much memory as possible.

--

At the moment Hyper-V only supports 4 virtual processors (VPs) per virtual machine. 

Recently Microsoft announced support for up to 24 cores (see KB article 956710) so it is now possible to run Hyper-V on a 4-socket 6-core machine (24 logical processors).

Tim Litton, Program Manager, Windows Server Performance. 

# Vybez said on March 9, 2009 6:28 AM:

I've heard that Microsoft permits only 4 virtual machines per physical server - is this true?

If not what's the maximum number of virtual machines permitted per physical machine

 --

Thanks for your question Vybez.

 

The number of active virtual machines that Hyper-V can support is certainly higher than 4, and is dependent on the physical characteristics of the machine.

 

Currently Windows Server 2008 Hyper-V supports up to 24 logical processors, with upto 8 virtual processors per logical processor.  This means that a machine with 24 logical processors can run up to 192 virtual processors (24 * 8 = 192).  
 

How the 192 virtual processors (VP) are used is quite flexible, it could be 192 VMs - each with 1 VP, or 96 VMs - each with 2 VPs, or 48 VMs - each with 4 VPs, or some combination in between.

 

Tim Litton, Program Manager, Windows Server Performance.

# Brady Houser said on April 16, 2009 9:57 AM:

Is there a difference between Windows Server 2008 Enterprise and Standard with the amount of processors that the virtual machines can access?

 --

Thanks for your question Brad.

 

When Windows Server 2008 is used as the guest operating system of a virtual machine, it can access up to 4 virtual processors.  Standard Edition supports up to 4 processors, so both Enterprise and Standard editions will let the virtual machine use all 4 virtual processors.

 

If your machine has more than 4 physical processors, you need to run Enterprise Edition of Windows Server 2008 for the root operating system to use all the processors to run the virtual processors. 

 

Tim Litton, Program Manager, Windows Server Performance.

Leave a Comment

(required) 
(optional)
(required) 
Page view tracker