[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.