Simple Question about Proxmox KVM and CPU Cores allocation

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

am4593

Active Member
Feb 20, 2017
150
36
28
44
Ok. A question that everyone has thought of which I cant find a simple answer to which i'm sure someone knows.

How do most hyper-visors treat CPUs with hyper threading for the purpose of CPU core allocation.

For example in Proxmox KVM if you allocate 4 cpus to a VM are you really just giving it two physical cores (which both use hyper threading) or are you actually giving it 4 physical cores.

I've also wondered the same thing under ESXI.

I do run a windows guest through KVM which I would really love to give 4 CPUs to. 4 real actual cpus, not 2x2. But I also dont want to over commit unintentionally.
 

vrod

Active Member
Jan 18, 2015
241
43
28
31
Give the amount of cores that are actually required, unnecessary extra cores can potentially degrade overall host performance if you over-provision the cores (vm’s will be fighting about the cores).

Hyperthreading just means that each core has an extra queue to handle work. Most virtualization technologies are clever enough to balance the workload. You can however set the affinity of a vm to specific cores on the hypervisor, however it will be bound to those cores then. You would usually then set it to 0, 2, 4 and 6 as 1, 3, 5 and 7 would be each core’s extra queue. I doubt you will gain anything however.