Comments on: Hyper-V Virtual CPUs Explained https://www.altaro.com/hyper-v/hyper-v-virtual-cpus-explained/ Hyper-V guides, how-tos, tips, and expert advice for system admins and IT professionals Wed, 31 Mar 2021 06:24:13 +0000 hourly 1 By: Tristan Ball https://www.altaro.com/hyper-v/hyper-v-virtual-cpus-explained/#comment-3710 Sat, 25 Jul 2020 12:11:00 +0000 http://hub.altaro.com/hyper-v/?p=4663#comment-3710 What about CPU Groups, exposed through Virtual Machine Resource Controls, the Host Compute service, and controlled via cpugroups.exe?

While a VM running on an isolated CPU Group isn’t necessarily pinned (in the sense of there being a 1:1 relationship between pCPU and vCPU ) – it’s pretty close, especially if you’ve configured the “minroot” configuration as given in the documentation.

Disclaimer: I haven’t actually tried it, I have only passing Hyper-V experience – but it seems relevant to the discussion, and didn’t seem to me mentioned?

Has anyone tried it?

]]>
By: Kim https://www.altaro.com/hyper-v/hyper-v-virtual-cpus-explained/#comment-3705 Thu, 16 Jul 2020 06:35:00 +0000 http://hub.altaro.com/hyper-v/?p=4663#comment-3705 In reply to George.

Yeah, and there is as much information in the comments. Good work Eric.
It have straighten out some more for me in this complex area.
And what? An 5yrs article still is alive…. Shows that this subject is still hot.

I was running our machine counting and distributed only the cores/threads, some years later I found that I could add mote threads to the VMs.
A machine with SBS2011 std with two WMs, the second with (Premium Addon) SQL-server.
Back then I took a while to understand, and rely on the Hyper-V thinking. But now I love it, and it have worked flawlessly over the years (today I more concerned that the core will f..k up).
Our new machine has 6C/12T, much more memory and such. This will be overkill for us, but our loveley SBS2011 has reached its EOL.

Keep up the good work – and thanks for an awesome article, even I still have some stuff I still can’t grasp.

]]>
By: Eric Siron https://www.altaro.com/hyper-v/hyper-v-virtual-cpus-explained/#comment-3690 Sun, 05 Jul 2020 20:45:00 +0000 http://hub.altaro.com/hyper-v/?p=4663#comment-3690 In reply to eamaul.

Check the counter for guest % run time on all of that VM’s vCPUs, but separately (don’t make one counter out of them all). If they’re all consistently above 90% during load times, add 2 vCPU. Repeat until the VM refuses to use additional vCPUs or until it stops surpassing 90% or until you can’t assign any more vCPU.

]]>
By: eamaul https://www.altaro.com/hyper-v/hyper-v-virtual-cpus-explained/#comment-3653 Thu, 14 May 2020 01:56:00 +0000 http://hub.altaro.com/hyper-v/?p=4663#comment-3653 I’ve a important question, how to know vcpu to pcpu ratio based on vm cpu performance? which counter i should use and how to apply it.

]]>
By: Tt78 https://www.altaro.com/hyper-v/hyper-v-virtual-cpus-explained/#comment-3614 Thu, 16 Apr 2020 13:56:00 +0000 http://hub.altaro.com/hyper-v/?p=4663#comment-3614 In reply to Jordan.

Intel didn’t create “Hyperthreading”, they merely implemented simultaneous multi-threading and marketed it as hyperthreading. The requirements for SMT are a superscalar architecture (i.e. more than one instruction can be dispatched and executed concurrently “per cpu core per clock” by today’s nomenclature), out of order execution and register renaming. The important thing to realize here is that more than one process context can be loaded in a CPU core concurrently and that’s why there are “logical” cores. The CPU pipeline has limited hardware resources (e.g, only one fp alu) so the concurrently executing threads in a single core only works well when they’re not competing for these resources (called a hardware hazard). This is where out of order execution comes into play – the CPU can execute a future instruction early if it knows hardware resource will be available. Enabling losing of more than one process concurrently increases the likelihood that a suitable instruction is found for execution.

The Alpha EV8 was going to be amazing 4 thread SMT CPU – until it was cancelled in favor of the (wait for it) Itanium. https://en.wikipedia.org/wiki/Alpha_21464

]]>
By: George https://www.altaro.com/hyper-v/hyper-v-virtual-cpus-explained/#comment-3267 Thu, 23 May 2019 07:45:00 +0000 http://hub.altaro.com/hyper-v/?p=4663#comment-3267 Very informative article. Thanks!

]]>
By: Eric Siron https://www.altaro.com/hyper-v/hyper-v-virtual-cpus-explained/#comment-3051 Wed, 07 Nov 2018 15:36:00 +0000 http://hub.altaro.com/hyper-v/?p=4663#comment-3051 In reply to Derdus.

You ask a very interesting question that I do not know the answer to. Power management schemes frequently cause unacceptable performance impacts so I turn it off on all production systems. The supporting thought process is that if we’re stuffing 30 or more instances onto one physical host, that’s plenty of power savings. So, it never dawned on me to see what DVFS would do. I’m not even sure that any of my systems have that capability.
I am not aware of any cloud-scaling hypervisor that will assign a core directly to a VM. I used an IBM iSeries system that appeared to have the ability to assign cores to LPARs, but that might just have been how the GUI was designed. Cloud vendors just track the amount of CPU resources used, not which CPUs were involved.
Hyper-V does include a CPU limit feature which is the inverse of the reservation feature; it sets a cap on total physical host CPU capability that a VM can consume at any given time. You find the setting in the same place as the reservation.

]]>
By: Derdus https://www.altaro.com/hyper-v/hyper-v-virtual-cpus-explained/#comment-3050 Wed, 07 Nov 2018 09:06:00 +0000 http://hub.altaro.com/hyper-v/?p=4663#comment-3050 Hello Eric,

Thank you for posting this content. I have been looking for something close to this.

I have a question though

In public IaaS clouds, customers select a VM with preset resources and they will certainly pay for these resources as long their VMs are active even if they are probably utilizing their resources say 20 % these resources. And you mentioned that when a VM is assigned a core, it is not that it is permanently allocated that vCPU permanently. If were to resize the VM resources, I would study resource usage for that VM then recommend. If the customer has to pick another VM size say a smaller one, they have to pick it from the available pool that is present by the IaaS vendor, if it is not available resources such harddisk size, bandwidth and memory could easily be adjusted. Is there away DVFS could be used to address this or in other hypervisors can one allocate a core to a VM permanently? Or is there a way the number of threads scheduled per unit time for such a VM could be reduced? Does DVFS for a whole CPU or it can work for a particular core?

]]>
By: Eric Siron https://www.altaro.com/hyper-v/hyper-v-virtual-cpus-explained/#comment-2912 Mon, 25 Jun 2018 22:04:00 +0000 http://hub.altaro.com/hyper-v/?p=4663#comment-2912 In reply to Gaston DASSIEU-BLANCHET.

If you give the VM 8 vCPU to match up with all logical cores, then it will drive the host as hard as it can, depending on how it needs to give up time slices to other VMs and the management operating system. Hyper-V is aware of the Hyper-threading situation and will distribute threads as best it can. It will do anything like limiting CPUs to 25% power.
Also, Hyper-V will not lock any one core to any one virtual machine or vCPU nor will it lock out any other vCPU from using those physical cores.
But no, it’s not a simple (100% x 4) (25% x 4) equation. You definitely have 100% of the power of 4 cores. How Hyper-threading impacts is more difficult to explain. Find Jordan’s comment on this thread for some very good starting information.

]]>
By: Gaston DASSIEU-BLANCHET https://www.altaro.com/hyper-v/hyper-v-virtual-cpus-explained/#comment-2905 Thu, 21 Jun 2018 04:57:00 +0000 http://hub.altaro.com/hyper-v/?p=4663#comment-2905 Hi Eric, great article.

And I have a question that’s been bothering me and I don’t seem to find the answer anywhere.

I understand that in a virtual environment, the host must guarantee SMP (symmetric multi-processing) to the guest VMs. It means that if we assign 2 CPU to a VM, and this VM is running one single thread (application) consuming 100% vCPU (50% of total VM vCPU resources), the VM will be fully allocated two pCPU on the host (the 2nd idle pCPU can not be used for another VM), wasting 50% of host pCPU resources.

Now, let’s say we have a 4pCPU host with Hyper Threading, meaning we have 8 logical CPUs.
However, the performance will be at best 25% for Hyper Threading as you mention in your article.

If we create an 8vCPU VM on this host, and we run a multi-threaded service (let’s say, Oracle), with a lot of heavy queries that overload all the CPUs (100% consumption).

In that case, we have 4vCPU running delivering 100% power and 4vCPU (the Hyper-Threaded ones) delivering 25% power, right?

But, if we consider that the host must guarantee SMP, does it not mean that in fact all 8vCPU are stuck at 25% power?

Not sure if my question makes sense… this topic is quite confusing.

I would much appreciate it if you could kindly enlighten me!

]]>