In Windows 2008 R2 Hyper-V running on a multicore server. When I create a new VM, it defaults to 1 logical processor, rather than the maximun (4). Is there any scenarios where I want to have my VM run on less processors than the Maximun allowed? It seems to make sense to me that I want it to perform as fast as possible and thus run on all possible processors.


I have been working with vm's for years, so here's my 2 cents. Everyone virtualizes for a reason... if you did it because it was the latest buzz word and a magazine said to do it forget about it and go back to using physicals. Now if you are virtualizing to give redundancy, then don't use up all your cpus. In a failover you will need the extra cpu power. If you virtualize because you have lots of small servers and you want to maximize the use of a physical server then use 80% of the cpus... and take a look at the profile over a week or two... if you can get away with putting 4 cpu on 2 servers because they are working at different times go ahead. Now the problem can be that if the host system starts using cpu and the guests start using it you will see a situation with the symptoms of the guests only have 70% cpu utilization but are bound like they are at 100%. This is bad. I hope by 4 cpu you mean 4 quad core cpus. Its hard to see any benifit from any less.


There's a cost to using extra virtual processors, both at the hypervisor layer and in the guest OS, alluded to in PHGamer's answer. As you add more virtual processors to a VM, those VPs will all attempt to take and release locks within the guest OS, slowing each other down somewhat. The scheduler within the hypervisor will also have more work to do, even, to some extent, when those extra virtual processor aren't busy.

So if you want the capacity of your VM to be very dynamic, add lots of virtual processors, understanding the cost.

If you want your machine to run most efficiently, though, don't add more virtual processors than the workloads generally need.

Multiverse IT's answer is somewhat relevant, too, though this problem can be partially solved by putting reserves on the amount of processor time other VMs get, making it harder for a runaway VM to monopolize the physical CPU time.

  • This is pretty much the good technical reason no to do it.
    – TomTom
    Oct 28 '10 at 6:29

Well if you got a ton of VMs running at the same time. having one VM hog all of the CPUs would be very bad no?

With the CPU choice you could have 4 VMs each with dedicated access to one CPU without any context switching happening.

  • 1
    True, but if I have two VMs on the same server you would expect them to reach peek load at different times, thus having each use all the phisical processors lead to better utilization, no? To put in another Way, 4 VMs with 4 virtual processors each, will utilize all the capacity of my phisical server, even if only one of the VMs is at peak load.
    – David Reis
    Oct 13 '10 at 1:44
  • Depends. This is a specific requirement and not a general one. For example multiple web servers may actually peak around the same time. Same for a large number of other posible servers.
    – TomTom
    Oct 28 '10 at 6:28

If the load is only single threaded then your unnecessarily putting scheduling load on the host for processor cycles that are wasted anyway. Virtualizing a server is an exercise in optimal resource allocation. If you're just throwing resources around where they're not needed, what's the point in consolidating them all in a single box?


Wow... you've never seen an update to Windows, antivirus software, or an app on your server that was bad and ends up running away with CPU usage. Would you REALLY want that one misbehaved update to bring down your other servers? Also, while YOUR environment may have predictable CPU usage, other environments could be very different. Similar to CrazyDart, the reasons to virtualize can differ from environment to environment. You might do it for power savings, you might do it for easier server migrations/recovery. You might do it for high availability in a cluster. You might do it for another reason. Your reasons for doing can impact how CPU allocation is handled.

You should also note, some significant enhancements are coming in SP1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.