All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: Calculating real cpu usage of Xen domains correctly!
@ 2005-02-24  0:48 Ian Pratt
  2005-02-24  1:02 ` Anthony Liguori
  0 siblings, 1 reply; 10+ messages in thread
From: Ian Pratt @ 2005-02-24  0:48 UTC (permalink / raw)
  To: Anthony Liguori, Jerone Young; +Cc: xen-devel, ian.pratt


Rather than trying to come up with metrics like this, I'd rather have
vm-top show the percentage of a physical CPU that each domain used,
independent of it's allocation.
i.e. total including the idle domain will be #CPUS x 100%.

Ian

> >1) CPU time % measured per domain
> >(The differential of cpu usage time / some differential time) x 100
> > new_cpu_time-old_cpu_time           new_time-old_time 
> >  
> >
> So for instance, measured over the course of a second, you might get:
> 
> Domain-0:  98%
> Domain-1: 99%
> Domain-2: 0%
> 
> Which implies that both Domain-0 and Domain-1 are actively running 
> Domain-2 is probably blocked on IO.  The typical expectation 
> is that the 
> sum of all the usages is going to be 100%.
> 
> >2) Relative usage .. How much of the total of the cpu times is going
> >toward a particular domain.
> >  
> >
> The idea here is to have a relative measure.  So if Domain-0 
> used 98% of 
> it's time, and Domain-1 used 99%, then the result is something like:
> 
> Domain-0: 49%
> Domain-1: 50%
> Domain-2: 0%
> 
> That looks more right.  However, we think that means making 
> assumptions 
> about the underlying scheduling algorithm (meaning that if the 
> difference in cpu_time over a period of time is the same for two 
> domains, that those two domains have gotten the same amount 
> of CPU time).
> 
> Any advice or recommendations would be greatly appreciated.
> 
> Regards,
> Anthony Liguori
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from 
> real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/xen-devel
> 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id\x14396&op=click

^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: Calculating real cpu usage of Xen domains correctly!  (PATCH)
@ 2005-02-26 20:27 Ian Pratt
  2005-02-28  6:20 ` Rob Gardner
  0 siblings, 1 reply; 10+ messages in thread
From: Ian Pratt @ 2005-02-26 20:27 UTC (permalink / raw)
  To: Rob Gardner, xen-devel; +Cc: ian.pratt

> OK, here is a patch which provides fine grained cpu utilization 
> reporting. Some notes:

I really can't see the point of this patch -- it isn't necessary to log
every scheduling operation to record CPU usage for a domain over
multiple time scales. 
Simply exporting the cumulative CPU usage for all domains and polling it
from dom0 will enable you to do this. If you do really want to log such
data, why not use the existing trace buffer infrastructure (though
admittedly it could do with some improvements -- it should be possible
for the user space reader to block until the event buffer becomes
half-full rather than having to poll, but I don't believe anyone has
added this functionality yet -- volunteers?).

Xen is already supposed to be doing the accounting -- though it has been
suggested there is a bug, which needs to be investigated. Its possible
it got broken when SMP guest support was added. If we do per VCPU
accounting the totals can be added to do per-domain. We should also
record the per physical CPU cumulative (non-idle domain) utilization
too.

Calculating utilization averages can be done with a simple user-space
tool. BTW: there are a couple of nice libaries for suporting simple
calculation of multi-scale rolling averages.

Ian

> - part of the code runs in the hypervisor to collect data, 
> and another 
> part of it runs in dom0 userland to process and display the data
> - the code contains vestiges of old features, and partially 
> implemented 
> new features; it is a work in progress.
> - this is the first time I'm sending out a patch to this list 
> so please 
> be gentle on me ;-)
> 
> Feedback appreciated!
> 
> Rob Gardner
> 
> 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id\x14396&op=click

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-02-28  6:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-24  0:48 Calculating real cpu usage of Xen domains correctly! Ian Pratt
2005-02-24  1:02 ` Anthony Liguori
2005-02-24  2:10   ` Andrew Theurer
2005-02-25  2:25   ` Matt Ayres
2005-02-25  2:38     ` Anthony Liguori
2005-02-25 16:44       ` Rob Gardner
2005-02-25 17:10         ` Anthony Liguori
2005-02-25 21:35           ` Calculating real cpu usage of Xen domains correctly! (PATCH) Rob Gardner
  -- strict thread matches above, loose matches on Subject: below --
2005-02-26 20:27 Ian Pratt
2005-02-28  6:20 ` Rob Gardner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.