Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

  OR

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
1  
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. wiki.xen.org/wiki/Xen_Best_Practices –  Kevin Parker Oct 24 '12 at 16:16
1  
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
2  
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
2  
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

1 Answer 1

up vote 3 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). http://support.citrix.com/article/CTX120713 : 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

 
discard

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.