Right after referring to our VPS plan page, our potential customers used to raise the sales chat. In 85% of cases, the first question we have been asked is… What is vCPU? That prompted me to write an article on this topic.
Although vCPU mathematics is a little tricky to understand, however, we have put together all possible information and tried to explain it in most simple words.
In HyperVisor physical CPU is fully controlled by the Hypervisor itself. This Physical CPU is divided into physical CPU cores. Each core very safely supports 8 virtual processors (vCPUs). vCPU does not represent one-to-one allocation. It represents time on the physical CPU resource pool. Now, let’s go through some technical terms first:
Sockets represent the hardware. They are referred to as the number of processor sockets that your motherboard is having. Sockets are the only capacity of motherboards. A socket can be empty. The real power is the number of processors that are actually installed on the motherboard.
A physical CPU is an actual hardware unit installed in the motherboard socket.
It is an actual physical processor/core in your physical CPU chipset (Multi-core processors). Each physical core acts as a separate processor since it has its own circuitry and L1, L2 cache.
Logical CPU/Logical processor (A little tricky)
Logical processors are abstractions of time on a stack of physical processors. Logical processors act differently in a physical machine (stand-alone) and in Hypervisor. In the context of Hypervisors, a Logical processor is equal to vCPU, but a Logical processor does not equal a physical core in any virtualization software.
vCPU is time dependent entity. A virtual processor is more likely the amount of processing time spent on the CPU. If we use technical terminology; Virtual processors are mapped to available logical processors in the physical computer and are scheduled by the Hypervisor software to allow you to have more virtual processors than you have logical processors. People may have the misconception that 1 vCPU equals 1 core. But there is no one-to-one relationship between vCPU and core in any virtualization software.
Let’s try to understand these terms with an Example. Here, we are considering that one physical core can safely support 8 virtual processors. Let’s see how this planning goes:
CPU we are taking into account is Intel Xeon CPU E5-2650 v2
- Intel Xeon CPU E5-2650 v2 holds 8 Cores x8 = 64 vCPUs.
- 4 vCPU to each VM…64 vCPUs / 4 vCPU per VM = 16 VMs
- 2 vCPU to each VM…64 vCPUs / 2 vCPU per VM = 32 VMs
- 1 vCPUs to each VM…64 vCPUs / 1 vCPU per VM = 64 VMs
As long as you don’t have CPU-exhaustive VMs, you can go beyond this number 8. The number of virtual cores that can be assigned to a VM is limited. Windows Server 2008 R2 limits the number of vCPUs to 4 per VM which is extended to 64 in Windows server 2012.