Search code examples
azurekubernetesazure-akshyperthreadingvcpu

Kubernetes CPU allocation: is vCore vs vCPU vs core in Azure?


I am running a Java application on an Azure Kubernetes node with a Standard_D8s_v3 VM. I am unsure about CPU allocation for a kubernetes deployment. This mentions that 1 CPU is equals to 1 Azure vCore. However the Azure VM specs mentions that Standard_D8s_v3 has 8 vCPUs (not vCores). What is the difference between vCPU and vCore?

Here you can see that the ratio of a Ds_v3 VM vCPU to cores (not vCores) is 2:1 due to Hyperthreading. Which means that 2 vCPUs are needed for the same performance of 1. Is vCore == core? If so, my assumption is that I should double the size of the VM.

Or, should I assume that 1 kubernetes CPU is equals to 1 vCPU?


Solution

  • Correct, 1 Kubernetes CPU equals 1 vCPU.

    For example i am using Standard_D4s_v3 nodes which have 4 vCPU according to here.

    When i do

    kubectl get nodes
    kubectl describe node <node-name>
    

    i can see this

    Capacity:
      cpu:                            4
    Allocatable:
      cpu:                            3860m
    

    Here is also good explanation whats the difference between a Core and vCPU on Azure.