Virtual Central Processing Unit (vCPU), as the name suggests is a virtual processor derived from the physical processor which is used to assign to a Virtual Machine (VM). A vCPU represents or shares a part of the physical processor and each vCPU is considered as an Physical Processor by the VM.
How Does a vCPU Work?
Virtual servers and their resource allocation are controlled by what is known as a hypervisor.
Simply put, a hypervisor is software used to create and run virtual machines (VMs). It allows one host computer to support multiple guest VMs by virtually sharing its resources such as memory and processor. The concept behind vCPUs can be explained as a share of the time spent on the processor’s core.
How is vCPU’s calculated?
vCPU is calculated by the number of processing threads of a chipset per core and multiplying the number of sockets present.
A thread is a path of execution within a process.
Simply put this is the formula for calculating the vCPUs: –
(Core x Thread) x No. of Physical CPU (Sockets) = Number of vCPU
Let us assume, A server with Single E3-1225 v3 processor contains 4 Core and 4 Thread, now the vCPU can be calculated using the above mentioned formula
(4 Core x 4 Thread) x 1 Physical CPU (Sockets) = 16 vCPU
How to calculate the number of Virtual Machines that can be created using vCPU’s?
As we have calculated the number of vCPU for E3 – 1225 v3 process, we can now find the number of VMs that can be created from the vCPU. So how is a vCPU assigned to a VM?
The Hypervisor which creates, runs and controls the VM, allows a single host server to have multiple guest VM’s.
The Number of VM is Calculated by dividing the total number of vCPU by the number of vCPU per VM required.
4 vCPU per VM
16 vCPU / 4 vCPU = 4 VM’s
2 vCPU per VM
16 vCPU / 2 vCPU = 8 VM’s
1 vCPU per VM
16 vCPU / 1 vCPU = 16 VM’s
vCPUs are assigned to VM based on the workloads, a higher workload requires a higher vCPU to process and perform the tasks easier and smoother, hence you need to know your workload and application profiles to determine the right configurations for your VMs.