Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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: but I need much more closer look.

share|improve this question

closed as off-topic by joeqwerty, Ward, mdpc, Tom O'Connor Mar 21 '14 at 9:42

This question appears to be off-topic. The users who voted to close gave these specific reasons:

  • "Questions must be relevant to professional system administration. Server Fault is dedicated to professional system and network administrators. End user and enthusiast questions are off-topic (contact your system administrator or hire a professional to help you out). Please see the Help Center for more information." – mdpc, Tom O'Connor
  • "Questions must demonstrate a minimal understanding of the problem being solved. Try including attempted solutions, why they didn't work, and the expected results. See How can I ask better questions on Server Fault? for further guidance." – joeqwerty, Ward
If this question can be reworded to fit the rules in the help center, please edit the question.

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

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.

share|improve this answer
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 '14 at 20:33
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. – Mike Naylor Mar 19 '14 at 20:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.