Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 am having intel EX5620 Cpu which has 4 Cores and 8 threads.

 cat /proc/cpuinfo is showing   8 cpus.

From xen's wiki page they are saying its better to assign each vm to cpu core for better performance.

So In this case does that mean i can run only 3 vms,if i assign one core to dom0 and rest 3 to each vms.


can i consider thread as core and thus run 7 vms each with cpu pinned to these threads and one for dom0.

Is there a way to assign vms cpu to thread rather than cores.Will that make any difference?

share|improve this question
Can you link to where in the wiki it says that? Because common sense says that should only make things worse. (Giving the scheduler fewer choices generally causes it to make worse scheduling decisions. Schedulers will already do that unless they have a good reason not to, and if there's a good reason not to do that, why would you want it?) – David Schwartz Oct 24 '12 at 16:10
@DavidSchwartz when scheduling what if a cpu may be busy with processing some other requests from a vm,in that case scheduler need to find another cpu which is not being used currently.This can cause performance degradation.If we assign each vm to a physical core then no other vm is going to pin that cpu as it has its own cpu to pin. – Kevin Parker Oct 24 '12 at 16:16
While that's completely true, that's certainly less performance degradation than would result from the core being idle rather than doing useful work! So yes, you can eliminate that performance degradation, but only by creating an even greater performance degradation. The scheduler completely understands this and would only make that core busy if it had useful work for that core to do and no better place to do it. – David Schwartz Oct 24 '12 at 16:25
I've read that page and don't see where it says you should do that. All I see is: "If you're running IO intensive guests or workloads in the VMs it might be a good idea to dedicate (pin) a CPU core only for dom0 use." (Hyperthreading allows one core to act much like two slower cores. However, the scheduler is smart enough not to run two threads in the physical core unless it makes sense to do so.) – David Schwartz Oct 24 '12 at 16:57
That requires registration and consent to receive emails. But the basic idea, that xen's scheduler is broken by default and requires you to do something to fix it, is just nonsense. Leave it alone. You can't make it work better by giving it fewer options. It knows how to pick the best options based on dynamic demand. All you'll wind up doing is force cores to be idle when they could be doing useful work just because it's the "wrong" work. – David Schwartz Oct 24 '12 at 17:56
up vote 4 down vote accepted

You have bad information. Citrix provides a equation to answer your underlying question about CPU assignments.

XenServer 5.0 Update 3 Admin Guide (p. 140). : Provision just enough Virtual CPUs (VCPUs) for each VM's workload.

Don't give a VM more VCPUs than it needs to do its work. If the server in a VM only needs around 300 MHz, it only needs 1 VCPU. Only give it one. If it regularly has 3000MHz worth of work on your 2.5GHz quad-core box, give it two VCPUs; but don't give it three or four. The number of VCPUs a VM has should reflect the amount of work it has to do. If your VM has 2 VCPUs, it should have more work than 1 physical core can do in a timely manner. If it has 4 VCPUs, it should have more work than 3 physical cores can do in a timely manner.

As a formal application of these principles for workloads that require multi-VCPU virtual machines,
allocate VCPUs to maintain this constraint: (V - N) <= (P - 1), where:
V = Total VCPUs across all VMs
N = Number of running VMs
P = Number of Physical CPU cores
share|improve this answer
thanx for your explanation,but could u tell me how can i determine current actively used CPU in Clock cycles. – Kevin Parker Feb 22 '13 at 4:24
The article doesn't say. But I would assume this is pretty easy to calculate: Give the VM a single CPU, boot it, and start it doing work. If the cpu graph stays around 50% then you just multiply the MHZ of a single core on your host machine, by 0.5 and that's how many MHZ work you require. – portforwardpodcast Feb 22 '13 at 5:24
ohh simple logic,,thanks :) – Kevin Parker Feb 22 '13 at 6:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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