xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Gaurav Dhiman <dimanuec@gmail.com>
To: Atsushi SAKAI <sakaia@jp.fujitsu.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: Estimating CPU utilization of DomU
Date: Fri, 16 Jul 2010 16:28:04 -0700	[thread overview]
Message-ID: <AANLkTilSct2iy_1u7Oexpv2agUPzyf3N1gmB9eKzahpG@mail.gmail.com> (raw)
In-Reply-To: <20100716081918.B9D41180A2@m021.s.css.fujitsu.com>

On Fri, Jul 16, 2010 at 1:19 AM, Atsushi SAKAI <sakaia@jp.fujitsu.com> wrote:
> Hi Guarav
>
>  You should test by xentop, instead of libvirt.
> Also you should write which kernel you are using.
>

Thanks for your reply. I will test with xentop as well. But what is
wrong with libvirt? Ultimately both of them use Xen APIs, right? I am
using Linux 2.6.30 pv_ops kernel as my Dom0, and Linux 2.6.18-xen
kernel (from the Xen website) as my DomU.

Thanks,
-Gaurav


> Gaurav Dhiman <dimanuec@gmail.com> wrote:
>
>> Hi All,
>>
>> I am trying to implement a small script to estimate the CPU
>> utilization of my DomU's from Domain-0 using libvirt APIs. I am using
>> the virDomainInfo structure for that:
>>
>> struct virDomainInfo{
>> unsigned char state   : the running state, one of virDomainState
>> unsigned long maxMem  : the maximum memory in KBytes allowed
>> unsigned long memory  : the memory in KBytes used by the domain
>> unsigned short        nrVirtCpu       : the number of virtual CPUs for the domain
>> unsigned long long    cpuTime : the CPU time used in nanoseconds
>> }
>>
>> So basically I query this structure for my DomU's every 'n' seconds,
>> and get the CPU utilization by taking the difference of cpuTime (in
>> seconds) and diving it by 'n'. To verify my estimates, I am running
>> sar inside my DomU's (I do 100-%idle to estimate CPU util). It works
>> perfectly for CPU intensive DomU's, but I observe some discrepancies
>> for I/O intensive DomU's. My scripts shows higher CPU utilization than
>> the sar output. Sometimes the difference is close to 10-15%. I am not
>> sure what is the reason for this? Is there some time which the DomU
>> VCPUs spend running, which sar cannot see? Or does the libvirt API add
>> up the time spent by domain-0 for work done on behalf of DomU to its
>> structure?
>>
>> Any insights here would be really helpful!
>>
>> Thanks,
>> -Gaurav
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>
>
>

      reply	other threads:[~2010-07-16 23:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-16  0:59 Estimating CPU utilization of DomU Gaurav Dhiman
2010-07-16  8:19 ` Atsushi SAKAI
2010-07-16 23:28   ` Gaurav Dhiman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTilSct2iy_1u7Oexpv2agUPzyf3N1gmB9eKzahpG@mail.gmail.com \
    --to=dimanuec@gmail.com \
    --cc=sakaia@jp.fujitsu.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).