Score:6

How do physical multi-core CPUs relate to vCPUs

bm flag

I've been told that the third-party application I need to host on a Windows Server 2022 box needs 3 CPUs with 8 cores but my enterprise cloud provision service (it's in-house at work) specifies computing power in terms of vCPUs.

What's the relationship between a multicore CPU and vCPUs?

cn flag
The application requires three CPUs with eight cores each. It means your application needs 3x8, or 24 processors/vCPU.
cn flag
A.L
Can you share the requirements of this application? Is it publicly available? I wonder if any motherboard has 3 CPU sockets, so the requirements may be impossible to fulfill with a bare metal server, then it's unclear why it requires 3 CPUs and not `x` vCPUs.
Score:10
in flag

vCPU's are an abstraction in virtualisation used for resource allocation. When the VM is running vCPU's are actually mapped to real CPU cores where the virtualisation/time-slicing mechanism hands out real CPU processing capability to the VMs as required.

Generally speaking virtualisation and server consolidation platforms should aim for a workload distribution that allows all guests the resources they need, when they need them. In that case:

1 virtual CPU (assigned to a guest / virtual server) equals 1 CPU core in the hypervisor.

In many cases not all VM's will be running at peak CPU load concurrently nor do they run peak CPU load all the time. That allows a certain level "over provisioning" i.e. assigning more vCPU's to virtual servers than there are cores actually present in the hypervisor.

When that works as intended: 1 virtual CPU core still equals 1 CPU core in the hypervisor when that is the amount of resources the VM needs.

When that doesn't work as intended and the hypervisor is (severely) overloaded ; there will be resource contention, sometimes called CPU steal time, and the virtualization software kicks in. Then instead of the capabilities of a full core a VM will get fewer resources for each vCPU than a whole core.


Note that vendor hardware requirements for their applications are often completely unrealistic IMHO. They are often terribly under or oversized.

The minimum requirements are frequently

  • with these specs the application installer can finish and application boots.

Which means

  • you will need to Scale up immediately once you start loading data and apply real life load

Or

  • these are the specs of our oversized beefy test server
  • We know that our application never runs into problems on our test server
  • So customers should also at a minimum get a similar setup

In most virtualisation setups you can easily assign additional resources so assign a reasonable number of resources to your VM initially (not the 3 x 8 cores = 24 vCPU's the vendor requires but a much lower number) and scale up and assign more resources WHEN NEEDED

endurium avatar
bm flag
thank you for your answer, unfortunately scaling up on demand isn't an easy process (thanks to the system used for budgeting) so I need to get it more or less right first time. I'm new to the whole VMs thing so your answer has proved most informative.
Matthew avatar
in flag
Keep in mind that typically in the cloud vCPU refers to a hyperthread in a CPU and not the actual core itself. For example, a 4-core hyperthreaded processor would show up as supporting 8 vCPU.
endurium avatar
bm flag
Yes, my Ryzen 5900X is 12 core but shows in Windows as 24 processors due to the HTs per core.
Score:2
ru flag

needs 3 CPUs with 8 cores

In the physical world "CPU" most often refers to populated CPU sockets. Three CPUs with eight cores each makes 24 cores.

"vCPU" in the virtual world refers to virtualized CPU cores. You'll need 24 vCPUs to meet the above requirement.

endurium avatar
bm flag
thanks @Zac67, so from what I understand about VMs and hypervisors, a physical CPU with say, 4 cores could host a VM with say 16 virtual cores, but it'd mean a performance hit due to the context switching the hypervisor would have to do if all 16 virtual cores (vCPUs) were being used?
Zac67 avatar
ru flag
@endurium It might depend on the hypervisor, but on the ones I've used you can't assign more vCPUs than the physical cores the hypervisor can use (including SMT cores).
mx flag
@Zac67 I’m genuinely curious what hypervisors you’ve used, because the _only_ ones I’ve seen that don’t let you overcommit on CPU cores are things just do hardware partitioning and nothing more. _All_ Type-2 hypervisors designed to run on consumer OSes inherently allow overcommitting CPU cores, as do Xen (and it’s derivatives), Hyper-V, VMWare ESXi, and even stuff like z/VM. Some UIs for interacting with them may refuse to let you overcommit, but that’s the UI, not the hypervisor itself.
Zac67 avatar
ru flag
@AustinHemmelgarn ... you can't assign more vCPUs *to a single VM* - see endurium's question above
mx flag
@Zac67 Ah, yes, misread the original question. All the type-1 hypervisors I know of block that by default these days because of speculative execution bugs, but almost all type-2 hypervisors out there do still let you do it.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.