Hi! I will have servers with different CPU specification: Quad core, dua core, one core. Each core appears as one VCPU for xen? How the management works when there is only one core, dual core and quad core? Suppose that I have 2 guests and for the quad core processor I give 2 VCPU to the dom0 and one for each domU. How it is managed? If DomU needs more CPU, it can use idle CPU from Dom0? If DomU is using idle CPU from Dom0 and Dom0 starts to need CPU, it will have their slice back? Thanks in advance. Regards, -- Augusto Castelan Carlson
Augusto Castelan Carlson wrote:> Hi! > > I will have servers with different CPU specification: > Quad core, dua core, one core. > > Each core appears as one VCPU for xen?Yes> > How the management works when there is only one core, dual core and quad core? > > Suppose that I have 2 guests and for the quad core processor I give 2 > VCPU to the dom0 and one for each domU. How it is managed? If DomU > needs more CPU, it can use idle CPU from Dom0? If DomU is using idle > CPU from Dom0 and Dom0 starts to need CPU, it will have their slice > back?The CPUs are not dedicated. I''ve not tried specifying more CPUs than I have, but I''m sure it''s mentioned in the docs. I would expect it to work. If you give any guest only one CPU, it will only use one CPU at a time, but not necessarily the same one all the time. If you want a guest to be able to use more than one CPU at a time, you need to specify two (or more) CPUs. I think you can dynamically change the number of CPUs, but you would need to check each guest OS to see whether it''s supported by that guest. -- Cheers John -- spambait 1aaaaaaa@coco.merseine.nu Z1aaaaaaa@coco.merseine.nu -- Advice http://webfoot.com/advice/email.top.php http://www.catb.org/~esr/faqs/smart-questions.html http://support.microsoft.com/kb/555375 You cannot reply off-list:-)
On Thursday 17 January 2008 12:22:30 pm John Summerfield wrote:> The CPUs are not dedicated. I''ve not tried specifying more CPUs than I > have, but I''m sure it''s mentioned in the docs. I would expect it to work. > > If you give any guest only one CPU, it will only use one CPU at a time, > but not necessarily the same one all the time. If you want a guest to be > able to use more than one CPU at a time, you need to specify two (or > more) CPUs. > > I think you can dynamically change the number of CPUs, but you would > need to check each guest OS to see whether it''s supported by that guest.There''s too much nonsense here; since I wrote that I''ve been editing some xen domain configurations using vim, and I see one _can_ assign a particular domain to a particular CPU, and one can specify that a particular domain can use specific CPUs. Whether libvirt supports that''s another matter. I''ve not noticed that it does.
> There''s too much nonsense here; since I wrote that I''ve been editing some xen > domain configurations using vim, and I see one _can_ assign a particular > domain to a particular CPU, and one can specify that a particular domain can > use specific CPUs. > > Whether libvirt supports that''s another matter. I''ve not noticed that it does.I would like to be able to give, for example, 33% for dom1 and dom2 and 33% for dom0, but I know that we can only work with VCPUs. How can I assign a specif VCPU ou CPU do domU? How CPU is Managend when I have one core only? independently of having one o more VCPU/CPU, suppose that Dom0 is idle, Dom1 is 80% CPU, and Dom2 is idle. Dom0 or Dom2 start to do some processing, how the CPU is managed? If there is 4 VCPU, 2 for dom0 and 1 dom1 and the other for dom2? I hope that you can understand my doubt :-D Thanks! Regards, Augusto
> I would like to be able to give, for example, 33% for dom1 and dom2 > and 33% for dom0, but I know that we can only work with VCPUs.It doesn''t work like this. Guests don''t normally consume CPU continuously (well, unless you''re running something like numerical simulations, which I really wouldn''t recommend for virtualization). First of all, if you do nothing at all then guests'' virtual CPUs are scheduled to run on physical CPUs at random. When a guest starts to do something, a physical CPU is picked and the guest runs on that for some short timeslice. You can easily have more virtual CPUs than physical CPUs. If your guests are mostly idle, the this is fine. Now you can also pin a virtual CPU to a subset of physical CPUs (or to just a single physical CPU). Using virsh/libvirt: virsh vcpupin guest 0 1 would pin guest''s virtual CPU #0 to physical CPU #1. So now when guest''s virtual CPU #0 wakes up to do some work, it will only be scheduled to run on physical CPU #1, if necessary waiting until physical CPU #1 becomes free. If you had a quad-core machine (4 physical CPUs) and 1 dom0 + 3 guests, and each dom0/guest has a single virtual CPU, then you might consider pinning the dom0 and each guest to a separate physical CPU. Whether this is a good idea or not depends on what each guest will be doing and requires careful analysis and performance monitoring. Use the command: virt-top -1 to show which guests are running on which physical CPUs in real time. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903
Richard W.M. Jones wrote:>> I would like to be able to give, for example, 33% for dom1 and dom2 >> and 33% for dom0, but I know that we can only work with VCPUs. > > It doesn''t work like this. Guests don''t normally consume CPU > continuously (well, unless you''re running something like numerical > simulations, which I really wouldn''t recommend for virtualization). > > First of all, if you do nothing at all then guests'' virtual CPUs are > scheduled to run on physical CPUs at random. When a guest starts to do > something, a physical CPU is picked and the guest runs on that for some > short timeslice. You can easily have more virtual CPUs than physical > CPUs. If your guests are mostly idle, the this is fine.Something that has occurred to me, and which troubled someone else, is that if the host is busy running Firefox, OOo and other desktop software as well as guest operating systems, those guests probably are not going to perform well. I think Xen will perform better in this sort of environment than KVM. The virtualisation software I''m most familiar with (from a theoretic POV) is IBM''s VM which runs on its mainframes. It''s a hypervisor only, and all users have their own virtual computer, and it''s those virtual computers that do the real work. Tuning VM to work best is an intricate job. VM is now about 40 years old. -- Cheers John -- spambait 1aaaaaaa@coco.merseine.nu Z1aaaaaaa@coco.merseine.nu -- Advice http://webfoot.com/advice/email.top.php http://www.catb.org/~esr/faqs/smart-questions.html http://support.microsoft.com/kb/555375 You cannot reply off-list:-)
That being noted, in Xen, I believe that a CPU is randomly selected and pinned to a VCPU for the entire session of the VM (this may only apply to HVMs), whereas, according to someone, virsh uses any available CPU. I assign my CPUs to my VMs for that reason. However, here is some information on scheduling processor usage as well: http://wiki.xensource.com/xenwiki/Scheduling?highlight=%28scheduling%29 It''s not especially detailed, but it may be what you are looking for, and while virsh may have a similar method, I am unfamiliar with virsh. Dustin -----Original Message----- From: fedora-xen-bounces@redhat.com [mailto:fedora-xen-bounces@redhat.com] On Behalf Of John Summerfield Sent: Friday, January 18, 2008 08:52 To: fedora-xen@redhat.com Subject: Re: [Fedora-xen] CPU management Richard W.M. Jones wrote:>> I would like to be able to give, for example, 33% for dom1 and dom2 >> and 33% for dom0, but I know that we can only work with VCPUs. > > It doesn''t work like this. Guests don''t normally consume CPU > continuously (well, unless you''re running something like numerical > simulations, which I really wouldn''t recommend for virtualization). > > First of all, if you do nothing at all then guests'' virtual CPUs are > scheduled to run on physical CPUs at random. When a guest starts to do > something, a physical CPU is picked and the guest runs on that for some > short timeslice. You can easily have more virtual CPUs than physical > CPUs. If your guests are mostly idle, the this is fine.Something that has occurred to me, and which troubled someone else, is that if the host is busy running Firefox, OOo and other desktop software as well as guest operating systems, those guests probably are not going to perform well. I think Xen will perform better in this sort of environment than KVM. The virtualisation software I''m most familiar with (from a theoretic POV) is IBM''s VM which runs on its mainframes. It''s a hypervisor only, and all users have their own virtual computer, and it''s those virtual computers that do the real work. Tuning VM to work best is an intricate job. VM is now about 40 years old. -- Cheers John -- spambait 1aaaaaaa@coco.merseine.nu Z1aaaaaaa@coco.merseine.nu -- Advice http://webfoot.com/advice/email.top.php http://www.catb.org/~esr/faqs/smart-questions.html http://support.microsoft.com/kb/555375 You cannot reply off-list:-) -- Fedora-xen mailing list Fedora-xen@redhat.com https://www.redhat.com/mailman/listinfo/fedora-xen