1

I would like to know how vCPU works and how its "connected" to the real CPU - how ESXi manages real CPU hardware resources to satisfy vCPU needs? Does vCPU uses all available cores, multithreading, etc? Where can I find any docs discribing specific algorithms of vCPU performance? VMware site is full of documentation I know I looked there but I found only things about configuring vCPU - but I would like to know what happens 'under the hood'.

Found this article: http://www.zdnet.com/virtual-cpus-the-overprovisioning-penalty-of-vcpu-to-pcpu-ratios-4010025185/ but I need much more closer look.

2
  • Magic. That's all you need to know. Mar 21, 2014 at 9:42
  • @Tom O'Connor♦: nice try, but I dont belive in magic :P
    – mirx
    Mar 23, 2014 at 14:26

1 Answer 1

8

I doubt you will find information about the algorithms in use. VMware likely considers their CPU scheduler as a trade secret (though I may be wrong here).

At a high level, a vCPU is an abstract construct that appears to the guest as a CPU core. The VMware CPU scheduler then takes data that needs to be executed from a vCPU and executes it on a physical CPU core. It is not guaranteed to execute on the same physical core as the last thread on that vCPU, but the scheduler does attempt to keep execution on the same CPU if possible for cache reasons, and if that is not possible, it tries to keep it on the same NUMA node - again for performance.

So a vCPU isn't a physical core. It isn't a physical CPU. It isn't executed across all physical cores simultaneously. It roughly equates to a physical CPU core in terms of performance in a system without resource contention, but it is not a 1:1 relationship between vCPU and physical core.

2
  • Thank you so much, very helpful info. Where did you read it? I would like to read an official doc to understand how it works deeper, cheers :)
    – mirx
    Mar 19, 2014 at 20:33
  • 2
    Think of it more as thread routing to available resources. When a process thread is started the hypervisor sends it to an available resource on the physical CPUs. As @MDMarra stated it may or may not run on the same core the next time the thread is called. NUMA nodes are important to performance as stated, check this blog article for a really good writeup of this and how NUMA nodes affect performance of the VM. Mar 19, 2014 at 20:48

Not the answer you're looking for? Browse other questions tagged .