WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] Why is Processor Utilization So High within the DomU?

To: "Robinson, Eric" <eric.robinson@xxxxxxxxx>, xen-users <xen-users@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-users] Why is Processor Utilization So High within the DomU?
From: Javier Guerra <javier@xxxxxxxxxxx>
Date: Wed, 25 Mar 2009 17:26:53 -0500
Cc:
Delivery-date: Wed, 25 Mar 2009 15:27:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <768FEA3F936926468F594E3CA7741FE801631E09@xxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <AcmthNqmeaT0P3msSfG1qjQYx16+cgAEMpIg> <768FEA3F936926468F594E3CA7741FE801631E09@xxxxxxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
On Wed, Mar 25, 2009 at 5:05 PM, Robinson, Eric <eric.robinson@xxxxxxxxx> wrote:
> Interesting. I'm just trying to avoid wasting physical core time. If my
> DomU has 2 VCPUs, and they are assigned to run on physical cores 1 and 2
> respectively, then it it possible to have another DomU with 2 VCPUs that
> are assigned to use the same 2 physical cores?

(please don't take discussions off-list unless it's too offtopic, i'm
're-on-list-ing' the thread)

yes, a real cpu can emulate several vCPUs.  that's the only way to
virtualise when you have a single core (yes, there was a time when
most machines had a single CPU).

even more, if you don't pin the vCPUs to specific CPUs, they'll be
switched around.  there's some 'processor affinity' that makes stay in
the same CPU whenever possible, but if the load gets too unbalanced,
it would be picked by other CPU.

just like processes in a multitasking OS.

and, like processes, if they fight for CPU, they'll get some fraction
of the prize.

you can think of each vCPU as a 'thread' on a multitasking OS.  a
single-vCPU VM is like a single-threaded process.  so, adding more
CPUs to the OS won't make the task any faster.  likewise, having more
threads than CPUs means they can't get a whole CPU each.

of course, the CPU isn't the only bottleneck, so when you have several
VMs running, and the total number of vCPUs is equal to the number of
real CPUs, you won't see total 100% processor load.  some (most?) of
the time, those vCPUs would be wainting for I/O.

>
> --
> Eric Robinson
>
>
> -----Original Message-----
> From: Javier Guerra [mailto:javier@xxxxxxxxxxx]
> Sent: Wednesday, March 25, 2009 1:04 PM
> To: Robinson, Eric
> Subject: Re: [Xen-users] Why is Processor Utilization So High within the
> DomU?
>
> On Wed, Mar 25, 2009 at 2:36 PM, Robinson, Eric
> <eric.robinson@xxxxxxxxx> wrote:
>> I thought the 1 VCPU had access to all the physical cores?
>
> nope.
>
> if that were possible, it would be the answer to all the multithreading
> development chores.  just write for one CPU, mount on a wonderVM with a
> 'megaVCPU' on top of lots of CPUs and you'd get magical paralelization!
>
> unfortunately, CPU time isn't a fluid quantity like water, or electical
> power.  you can't put several CPUs to do one linear job (like emulating
> a vCPU) faster, it has to be a parallelizable job (like emulating
> several vCPUs)
>
> --
> Javier


-- 
Javier

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

<Prev in Thread] Current Thread [Next in Thread>