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:
Socket
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.
Physical CPU
A physical CPU is an actual hardware unit installed in the motherboard socket.
Physical core/core
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.
Virtual processor/vCPU
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.
The Intel Xeon CPU E5-2650 v2 has only 8 cores. You mentioned 16 cores! It has 16 threads as each core can support 2 threads. So 16 vCPU shares 1 core of 2.6Ghz. So each vCPU only has 0.1625 Ghz! That’s so little. This is why VPS with 1 or 2 vCPUs are very slow. The other thing to notice is that the real speed of each vCPU depends on the model of the real CPU. The newer and more expensive ones are faster so teh vCPUs are faster too. But then nothing stops hosting companies to dilute that power by adding more vCPUs per physical core. So there does not seem to be any standard at all. There is no way for users to know how fast each vCPU is unless the hosting company publish info on vCPU they have set up in term of clock speed in Ghz.
Hello Peter,
Thanks for the feedback. We have updated the CPU cores and the table on the blog. Please note that we are considering 8vCPU/cores and not 16vCPU/core as recommended by Microsoft here.
Btw i have a general question if you can help with it. i seen some small dedicated server with 4 core is costly than a VPS with 16 vcpus / core .. can you please advise on it ?
The 16 vcpus assigned with a VPS are shared among other VPS hosted on the same server. However, in a bare metal server, if there are 4 cores, they are dedicated to your requirements. So, VPS are mostly cheaper than dedicated servers.
if I have Xeon platinum processor with 28 cores and capable of hyperthreading, based on your calcs it should then support ( 28 x 2 x 8 = 448 vCPU’s)
Also, VM ware recommends A virtual machine cannot have more virtual CPUs than the number of logical cores on the host. that being said the number of VM’s possible with the above processor is 448/56= 8 VM’s max. Am I right ?
If the above calcs are correct and If I have an application that needs 32cores to run on a physical server, and If I want to virtualize it on the above server with Xeon plantinum 28 core processor, should I be looking at 32 vCPU’s per VM ?
Appreciate your thoughts on this.
Hi Srini,
Our calculation is for fair usage. This allows you to allocate more virtual CPU based on requirements. But you cannot use more than total number CPU cores which are available on the physical host. If your physical server has 28 cores, you cannot use more than 28 cores and some virtualization may not even allow you to set higher number of CPU cores than total available physical cores. Whenever you are going to host many VMs on a physical server, you have to monitor the performance of the host server. This will ensure that you are not running out of CPU processing power.
Thanks!
why x8 ? CPU E5-2650 has 16 threads