VMware Cloud Community
manishisarda
Contributor
Contributor

Are vCPUs from same SMP VM are scheduled on same Physical processor ?

Hi,

I was reading arrounding how ESX server do scheduling job. came accross terms like co-scheduling. Rather than solving my problem it confused me. So I am having QUESTIONS

1. Are vCPUs from same SMP VM are scheduled on same Physical processor ?

2. can i create 4 vCPU VM on dual core processor.

3. All vCPU from SMP VM shold be scheduled at same time(For better performance)?

Tags (3)
Reply
0 Kudos
5 Replies
Dave_Mishchenko
Immortal
Immortal

1. Are vCPUs from same SMP VM are scheduled on same Physical processor ?

No - each vCPU would run on a seperate physical CPU core. The vCPUs can not run on the same CPU core (at the same time).

2. can i create 4 vCPU VM on dual core processor.

No - you would require 4 logical CPUs to be able to create a 4 vCPU VM. In your case you would need a server with 2 dual-core processors.

3. All vCPU from SMP VM shold be scheduled at same time(For better performance)?

vCPUs in a SMP VM are allows scheduled to execute as the same time. They can not execute one at a time. So with a 4 vCPU VM, ESX needs to find 4 CPU cores that are free at the same time. This can lead to scheduling problems in the server has many other vCPUs from other VMs to schedule, and in general you should avoid using vSMP unless the VM really needs to the extra CPU resources. It's best to start with 1 vCPU and then change it later if it needs it.

manishisarda
Contributor
Contributor

Hi ,

Thanks for such quick response.

I am confused with your answer to my Question no 3.

as per you, ESX sever will schedule an SMP VM with 4vCPU to Schedule only if it find 4 free physical processor core.Then what purpose of co-scheduling algorithm.whatever i understood from this algorithm is there can be difference between execution of 2vCPU of sam SMP VM. it is know as "skew". Can you explain in details how ESX 3.5 scheduler works for 4vCPU SMP VM.

Thanks again.

Reply
0 Kudos
Dave_Mishchenko
Immortal
Immortal

Here's a few good documents to look at regarding skew. You're right in that it's simplistic to say that all 4 vCPUs will run at the same time, but at the same time ESX won't let vCPUs get too far out of sync (i.e. one vCPU getting more physical CPU cycles than then others). So when planning to use vSMP you have to be careful that you avoid the problem where your VMs have to wait because the skew threshold has been crossed.

http://communities.vmware.com/docs/DOC-4960

http://blogs.vmware.com/performance/2008/06/esx-scheduler-s.html

Reply
0 Kudos
weinstein5
Immortal
Immortal

I will see if I can explain - as Dave indicated the vmkernel will schedule the vcpus of a virtual smp vm simultaneously - the problem is the vmkernel is not aware of this skew all it can assume is the vcpus will need the same number of cycles - this applies for a 4 vcpu vm as well - so if the vmkernel does not have enough cycles to schedule all 4 vcpus at the same time it will not schedule any of them - as Dave also mention because of this it is better to start with a single vcpu and only increase the number of vcpus if needed unless of course through capacity planner you have emperical evidence that you do need a multi vcpu vm - think of it this way it is easier to schedule a single vcpu than 2 or 4 -

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
Reply
0 Kudos
TomHowarth
Leadership
Leadership

Hi,

I was reading arrounding how ESX server do scheduling job. came accross terms like co-scheduling. Rather than solving my problem it confused me. So I am having QUESTIONS

1. Are vCPUs from same SMP VM are scheduled on same Physical processor ?

The scheduler will try to maximise the use of the pCPU cache and will schedule each vCPU against a logical core in the same CPU if posible.

2. can i create 4 vCPU VM on dual core processor.

No you need at least as many logical cores as vCPUs

3. All vCPU from SMP VM shold be scheduled at same time(For better performance)?

a SMP guest will need as many logical pCPUs or Cores available as there are vCPUs assigned to the guest before it will be able to execute a CPU instruction. therefore a dual CPU Guest will require 2 CPUs or cores available and a quad CPU guest will require 4 CPUs or Cores available.

Tom Howarth

VMware Communities User Moderator

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410