We have recently purchased a server which is running Hyper-V 2008 R2 bare metal. The server has two quad-core Intel Xeon processors with hyperthreading, so if I'm understanding correctly this gives us 16 cores. Within Hyper-V we have created a virtual machine running Windows Server 2008 R2 with 4 virtual processors. The processor settings screen is telling me that this represents 25% of the total system processing power. Does this mean that the remaining 75% can not be tapped into by the virtual OS? We will be running a few other virtual machines, but this one is for SQL Server and we'd like to throw as much horsepower at it as possible.
5You want to be exceedingly careful about allocating vCPUs to a machine. It means that the virtual machine has to wait until there are 4 physical processors are available at the same time before it can execute. See here– HolocrypticMay 16, 2011 at 18:36
6As far as Hyperthreading goes, take a look at this excellent primer: arstechnica.com/old/content/2002/10/hyperthreading.ars– HyppyMay 16, 2011 at 18:38
4Holocryptic, your statement was true of older VMWare systems, but it has never been true of Hyper-V. Hyper-V doesn't "gang schedule" the virtual processors.– Jake OshinsMay 17, 2011 at 5:59
A vCPU can only be mapped to a single physical CPU. You can't take 4 physical CPUs and make a single vCPU that's 4x faster; it's just not how it works.
Hyper-V is limited to assigning 4 vCPUs to a VM (last I checked). If you need significant CPU power, go physical, there's no sense in adding virtualization overhead to something that CPU intensive and parallel in the first place.
Also, as Holocryptic notes, if you assign 4 vCPUs to a VM, that VM can't run until Hyper-V has acquired 4 physical CPU cores to run them on. Depending on your configuration this could be a major stumbling block (ex, if you have a 6-core machine with a bunch of 4 vCPU VMs, only one will ever run at a time, the other two cores will always go essentially unused). According to Jake Oshins this was not true for any version of Hyper-V. He states that Hyper-V does not use gang scheduling for the CPU; as almost every other hypervisor does. Accordingly, if one phystical CPU core is available, Hyper-V may use it to run a multi-CPU VM. (Also mentioned, Hyper-V may not use all the physical cores available at the time because of NUMA partitioning)
Side note: SQL doesn't necessarily use all the cores you can throw at it in the first place. It really depends on what you're using it for and how parallelizable the load is.
I agree, but the overhead on virtual CPUs is almost nothing, and rarely comes into play.– NateMay 16, 2011 at 18:42
4Chris, Holocryptic's note is simply wrong. Hyper-V does not wait until there are 4 virtual CPUs free before scheduling a virtual processor from a 4 VP VM. Hyper-V schedules a virtual processor whenever it has a physical processor free to run it on, with a few caveats. For instance, it looks for physical processors within the same physical NUMA node as the rest of the VM. May 19, 2011 at 5:33
Yep, What Chris said. If you need more then 4 CPU's in a Hyper-V virtual machine then either create two SQL servers in virtual and spread out your databases or go physical. Depending on your SQL server license you may be able to add more SQL servers in virtual (on the same physical host) without occurring more licensing costs, but read the SQL virtual licensing white paper for more info.
I would also agree that if you have SQL running out of CPU power with 4 virtual CPU's then you've either got some serious app utilization or the SQL commands are badly written.
1Re: "...or the SQL commands are badly written." This is almost guaranteed, whenever vendor-supplied code is in play.– SkyhawkMay 16, 2011 at 20:33
Indeed, most database traffic is OLTP stuff from our ERP system. We also have a workflow system from the same vendor. Custom stuff written in-house is a small percentage.– ScottMay 17, 2011 at 15:53
Our old database is running maxed out on 4 logical cores (two dual-core CPUs), so we're expecting to need more than that.– ScottMay 17, 2011 at 15:55
About 4 CPU core limit:
In VM's config file section:
[processors] [count type=”integer”]16[/count]
Now you have 16 core CPU.
UPDATE: Seems screenshot needed
follow this guide
you can locate the vm xml configuration file under the "Virtual Machines" directory of the VM's VHD directory, the configuration file will be named under the VM's id. Below link is a reference.
reference: VM xml configuration file
make sure you edit the VM xml configuration file with notepad/notepad++ opened under administrator privileges