Hello Everyone, I am hoping I can get some help with how vCPUs work with weights and caps 1. If I have a domU with 2 vCPUs and a weight of 256, does the weight double (512) or is this 256 time slice across both vCPUs. If the weight does not double, how is it beneficial to have multiple vCPUs? 2. If the domU has 2vCPUs and a cap of 100% how does this work since 100% is a mex of one physical CPU. Thanks, Mohamed
On 01/09/2013 07:30 PM, mohammed.king@gmail.com wrote:> Hello Everyone, > > I am hoping I can get some help with how vCPUs work with weights and caps > > 1. If I have a domU with 2 vCPUs and a weight of 256, does the weight double (512) or is this 256 time slice across both vCPUs. If the weight does not double, how is it beneficial to have multiple vCPUs? > > 2. If the domU has 2vCPUs and a cap of 100% how does this work since 100% is a mex of one physical CPU. > > Thanks, > Mohamed > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xen.org > http://lists.xen.org/xen-users >Hi Mohammed, both of these are related to Credit scheduler [1]. Weight is domain attribute (not vCPU) and the benefit of this is to effectively distribute the CPU time between the domains. The domain with higher weight has better chance to get CPU time. The cap is the maximum of CPU the domain can have available. Read the "Algorithm" section on that wiki and everything will be clear for you. It''s always better to read some documentation before asking such questions. ;-) [1] http://wiki.xen.org/wiki/Credit_Scheduler BR, -- Peter Viskup
Hi Peter, Thanks for the response. I did look at the docs prior to asking. I guess what I am asking is what the advantages would be if you have say 2 vCPUs on a VM. Sent from my iPad On Jan 9, 2013, at 9:00 PM, Peter Viskup <skupko.sk@gmail.com> wrote:> On 01/09/2013 07:30 PM, mohammed.king@gmail.com wrote: >> Hello Everyone, >> >> I am hoping I can get some help with how vCPUs work with weights and caps >> >> 1. If I have a domU with 2 vCPUs and a weight of 256, does the weight double (512) or is this 256 time slice across both vCPUs. If the weight does not double, how is it beneficial to have multiple vCPUs? >> >> 2. If the domU has 2vCPUs and a cap of 100% how does this work since 100% is a mex of one physical CPU. >> >> Thanks, >> Mohamed >> _______________________________________________ >> Xen-users mailing list >> Xen-users@lists.xen.org >> http://lists.xen.org/xen-users > > Hi Mohammed, > both of these are related to Credit scheduler [1]. > Weight is domain attribute (not vCPU) and the benefit of this is to effectively distribute the CPU time between the domains. The domain with higher weight has better chance to get CPU time. > The cap is the maximum of CPU the domain can have available. > Read the "Algorithm" section on that wiki and everything will be clear for you. It''s always better to read some documentation before asking such questions. ;-) > > [1] http://wiki.xen.org/wiki/Credit_Scheduler > > BR, > -- > Peter Viskup
On 01/13/2013 06:12 PM, Mohamed King wrote:> Hi Peter, > > Thanks for the response. I did look at the docs prior to asking. I guess what I am asking is what the advantages would be if you have say 2 vCPUs on a VM. > > > Sent from my iPadHi Mohamed, I understand its advantage as better possibility to schedule provided CPU time between the processes within the VM. Of course your VM will not be able to use more than 100% of one physical CPU, but should be able to run another process once one will block the first vCPU (and only in case the VM will still have enough credits on hypervisor - if credit scheduler is used). It''s good to have more vCPUs on webhosting for example and on all systems where do you expect parallel data processing (webservers, databases, virtual desktop, ...). This is my understanding. <correct me if I''m wrong> Best regards, -- Peter Viskup
On 01/13/2013 07:33 PM, Peter Viskup wrote:> On 01/13/2013 06:12 PM, Mohamed King wrote: >> Hi Peter, >> >> Thanks for the response. I did look at the docs prior to asking. I >> guess what I am asking is what the advantages would be if you have >> say 2 vCPUs on a VM. >> >> >> Sent from my iPad > > Hi Mohamed, > I understand its advantage as better possibility to schedule provided > CPU time between the processes within the VM. Of course your VM will > not be able to use more than 100% of one physical CPU, but should be > able to run another process once one will block the first vCPU (and > only in case the VM will still have enough credits on hypervisor - if > credit scheduler is used). It''s good to have more vCPUs on webhosting > for example and on all systems where do you expect parallel data > processing (webservers, databases, virtual desktop, ...). > This is my understanding. <correct me if I''m wrong> > > Best regards, > -- > Peter ViskupJust one other thing where it is expected to have more vCPUs. You are not allowed to assign more cap than 100% to VM with only one vCPU. In other words one vCPU can have a max. of 100% of real CPU power. That means in case you need to assign more CPU time to the VM you need to setup more vCPUs for that VM - based on the VM requirements (e.g. at least 3vCPUs for VM with cap=280). BR, -- Peter
Peter, Thank you so much, that explains it. Thank you, Mohamed King On Jan 13, 2013, at 1:39 PM, Peter Viskup <skupko.sk@gmail.com> wrote:> On 01/13/2013 07:33 PM, Peter Viskup wrote: >> On 01/13/2013 06:12 PM, Mohamed King wrote: >>> Hi Peter, >>> >>> Thanks for the response. I did look at the docs prior to asking. I guess what I am asking is what the advantages would be if you have say 2 vCPUs on a VM. >>> >>> >>> Sent from my iPad >> >> Hi Mohamed, >> I understand its advantage as better possibility to schedule provided CPU time between the processes within the VM. Of course your VM will not be able to use more than 100% of one physical CPU, but should be able to run another process once one will block the first vCPU (and only in case the VM will still have enough credits on hypervisor - if credit scheduler is used). It''s good to have more vCPUs on webhosting for example and on all systems where do you expect parallel data processing (webservers, databases, virtual desktop, ...). >> This is my understanding. <correct me if I''m wrong> >> >> Best regards, >> -- >> Peter Viskup > > Just one other thing where it is expected to have more vCPUs. > You are not allowed to assign more cap than 100% to VM with only one vCPU. In other words one vCPU can have a max. of 100% of real CPU power. That means in case you need to assign more CPU time to the VM you need to setup more vCPUs for that VM - based on the VM requirements (e.g. at least 3vCPUs for VM with cap=280). > > BR, > -- > Peter