Physical vs logical vs virtual cores

My processor has 4 physical cores. Maximum of 8 virtual cores per core. Does the following applies:

  • if hyper threading is enabled than 4x 2 = 8 logical cores. Which means 8 x 8 = 64 maximum virtual cores

  • if hyper threading is not enabled than it's 4 x 8 = 32 maximum virtual cores.Or is it always 4x8=32 virtual cores?

2

3 Answers

Hi there are some few basics which help you to understand:
1. The more physical cores you have, better will be the performance
2. Logical cores in a single physical processor helps the processor to multitask but not better as compare to having a dedicated physical processor
3. Hyper threading is a process to achieve multi core performance in a single physical core
4. Hyper threading does not multiply logical cores, their implementation is already fixed by manufacturer
5. Hyper threading allows the CPU load to distribute in the cores and if more distribution required, then divide the load within a physical core with different technologies like time slicing, round robin etc

So if your CPU is having 4 physical cores with maximum of 8 logical/virtual cores per core then is will always be 4x8 = 32 cores
Hope this will help you. :-)

No. In this context, logical processors and "virtual cores" are the same thing. If you enable hyperthreading, then you have two logical processors per physical core. So, total, you have eight logical processors, or eight virtual cores, whichever term you want to use.

Without hyperthreading, you have just one LP per physical core.

In the context of VMs/hypervisors (with Azure VMs in mind):

Hypervisor is the piece of software that is in charge of allocating compute to VMs. Let's say we have 2 types of host processors:

  1. Compute A: Hyperthreaded processor with 4 physical cores
  2. Compute B: No hyperthreaded processor with 4 physical cores

Let's say we create 2 VMs, 1 that needs less compute power (VM X) and 1 that needs more compute power (VM Y).

Compute A:

  1. Hypervisor allocates 1 physical core to VM X as 1 virtual core
  2. VM X then gets 2 logical cores, meaning 2 vCPUs
  3. So there are 2 vCPUs, 2 logical cores, 1 virtual core, 1 physical core involved for VM X
  4. Hypervisor allocates 2 physical cores to VM Y as 2 virtual cores
  5. VM Y then gets 4 logical cores, meaning 4 vCPUs
  6. So there are 4 vCPUs, 4 logical cores, 2 virtual cores, 2 physical cores involved for VM Y

Compute B:

  1. Hypervisor allocates 1 physical core to VM X as 1 virtual core
  2. VM X then gets 1 logical core, meaning 1 vCPU
  3. So there is 1 vCPU, 1 logical core, 1 virtual core, 1 physical core involved for VM X
  4. Hypervisor allocates 2 physical cores to VM Y as 2 virtual cores
  5. VM Y then gets 2 logical cores, meaning 2 vCPUs
  6. So there are 2 vCPUs, 2 logical cores, 2 virtual cores, 2 physical cores involved for VM Y

For a VM there is no such thing as physical core, but a virtual core (which is being made to appear like a physical core exactly the way the virtual machine itself is being made to appear like a physical machine). Note, here we assume that 1 physical core is presented as 1 virtual core for VM. However hypervisor may decide to club 2 physical cores and abstract them as 1 virtual core for a VM (or in general M physical cores can be abstracted into N virtual cores). The logical cores would follow then based on hyperthreading factor.

The number of vCPUs is same as the number of logical cores a virtual core (hence underlying number of physical cores) supports. [Sources: Azure Alan, VMWare]

Source text (in case source hyperlinks break):

Azure Alan:Azure Alan

VMWare:VMWare

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like