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-devel

Re: [Xen-devel] Estimating CPU utilization of DomU

To: Atsushi SAKAI <sakaia@xxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Estimating CPU utilization of DomU
From: Gaurav Dhiman <dimanuec@xxxxxxxxx>
Date: Fri, 16 Jul 2010 16:28:04 -0700
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 16 Jul 2010 16:28:54 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=fDESEPMIYoriVi+c+qt3LKGxDUUrDHCtsmJOgy1IyCA=; b=sMK/3zllyJCqgPib6z9yGuzbXxEkSWNUOtyC4IpgwrZv0w/yOCDc+EiqarUO8eoVzm 3e+J5mhnblAudcGlUmWL++5kAim53l79SX7Mqapvy3kFMrAni/2uNs4bVl3RPuqLeE/J kxD8Ge1HNidCNh1DlRIhdA9/1ntpHim9s/vkg=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Hcq4G8WiwCzkBEN+vzQlRCIF+EHNip9kiKYv2Ob1CbMuHi8VpZmie1hO9F15tytWrH UFcxnyTgiTk7/odT5/Nh5S4yW8iFZq/OGWz+OUESZbbRsdYO84z+wVYEq2xGjOHXcY40 P9bnsEoCk1H0gV9aFVQ/AE13XkfqsbrPAcQhk=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20100716081918.B9D41180A2@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <AANLkTiljkStOWDh-1PfxYA6EQythG9cK-1gL67hzXWuX@xxxxxxxxxxxxxx> <20100716081918.B9D41180A2@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Fri, Jul 16, 2010 at 1:19 AM, Atsushi SAKAI <sakaia@xxxxxxxxxxxxxx> 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@xxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxx
>> http://lists.xensource.com/xen-devel
>
>
>

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

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