All of lore.kernel.org
 help / color / mirror / Atom feed
* confusions on monitoring VM cpu usage in Xen hypervisor
@ 2014-02-20  8:09 =?gb18030?B?Q2hhcmxlcw==?=
  2014-02-21 17:42 ` Dario Faggioli
  2014-02-21 22:19 ` confusions on monitoring VM cpu usage in Xen hypervisor Mukesh Rathor
  0 siblings, 2 replies; 5+ messages in thread
From: =?gb18030?B?Q2hhcmxlcw==?= @ 2014-02-20  8:09 UTC (permalink / raw)
  To: =?gb18030?B?eGVuLWRldmVs?=

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb18030", Size: 700 bytes --]

Hi everyone, I¡®m trying to monitor the VM CPU usage in xen hypervisor and use the VM CPU usage 
information in Xen's Credit Scheduler. I googled it, and find that most references about this topic is monitoring the VM CPU usage information in Domain-0 while not in the Xen hypervisor.
I'm now blocking at how to determine the state of vCPU, My understanding is that vCPU running on a physical CPU doesn't mean it really consumes CPU cycles, so I could determine the whether vCPU is consuming CPU cycles or not? So could you please give me some advice.

Thank you very much!
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: confusions on monitoring VM cpu usage in Xen hypervisor
  2014-02-20  8:09 confusions on monitoring VM cpu usage in Xen hypervisor =?gb18030?B?Q2hhcmxlcw==?=
@ 2014-02-21 17:42 ` Dario Faggioli
       [not found]   ` <tencent_1F08A5736F1E5981265AE0C8@qq.com>
  2014-02-21 22:19 ` confusions on monitoring VM cpu usage in Xen hypervisor Mukesh Rathor
  1 sibling, 1 reply; 5+ messages in thread
From: Dario Faggioli @ 2014-02-21 17:42 UTC (permalink / raw)
  To: Charles; +Cc: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 2035 bytes --]

On gio, 2014-02-20 at 16:09 +0800, Charles wrote:
> Hi everyone, I‘m trying to monitor the VM CPU usage in xen hypervisor and use the VM CPU usage 
> information in Xen's Credit Scheduler. 
>
Monitoring how? More important, "use the usage information in Credit"
how and for what purpose?

Providing as much info as possible on the final goal is often very
important for us to be able to help you.

> I googled it, and find that most references about this topic is monitoring the VM CPU usage information in Domain-0 while not in the Xen hypervisor.
>
Provided that I really would like you to define better what you mean
with "VM CPU usage", what I can say is that credit does not have any
load tracking mechanism. Credit2 has, and it would be possible (and
nice!) to abstract that from there and make it available for all
schedulers.

Basically, that means moving some of the code in schedule.c, as well as
add some callbacks, to be implemente by the various scheduler (Credit,
Credit2, etc).

This is something I have on my TODO list since a while, but did not
manage to get to it yet. If you think this would be helpful for you too,
and you're up for helping, I'll be share to discuss/share more.

> I'm now blocking at how to determine the state of vCPU, My understanding is that vCPU running on a physical CPU doesn't mean it really consumes CPU cycles, so I could determine the whether vCPU is consuming CPU cycles or not? So could you please give me some advice.
>
Mmm... if a vCPU is _running_ on a pCPU, I would say it is consuming
pCPU cycles... But perhaps I am not understanding what you really mean
here. So, again, please try to describe your final goal, I'm sure it
will help figuring out things better.

Regards,
Dario

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: confusions on monitoring VM cpu usage in Xen hypervisor
  2014-02-20  8:09 confusions on monitoring VM cpu usage in Xen hypervisor =?gb18030?B?Q2hhcmxlcw==?=
  2014-02-21 17:42 ` Dario Faggioli
@ 2014-02-21 22:19 ` Mukesh Rathor
  1 sibling, 0 replies; 5+ messages in thread
From: Mukesh Rathor @ 2014-02-21 22:19 UTC (permalink / raw)
  To: Charles; +Cc: xen-devel

On Thu, 20 Feb 2014 16:09:31 +0800
"Charles" <xiezhenjiang@foxmail.com> wrote:

> Hi everyone, I‘m trying to monitor the VM CPU usage in xen hypervisor
> and use the VM CPU usage information in Xen's Credit Scheduler. I
> googled it, and find that most references about this topic is
> monitoring the VM CPU usage information in Domain-0 while not in the
> Xen hypervisor. I'm now blocking at how to determine the state of
> vCPU, My understanding is that vCPU running on a physical CPU doesn't
> mean it really consumes CPU cycles, so I could determine the whether
> vCPU is consuming CPU cycles or not? So could you please give me some
> advice.
> 
> Thank you very much!
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


Checkout simple utility called 'xmstat' I wrote a while ago, you might 
find it useful as it will tell you how vcpus are bouncing around and 
consuming cpus:

http://old-list-archives.xenproject.org/archives/html/xen-devel/2010-08/msg01586.html

thanks
mukesh

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: confusions on monitoring VM cpu usage in Xenhypervisor
       [not found]   ` <tencent_1F08A5736F1E5981265AE0C8@qq.com>
@ 2014-02-24 17:06     ` Dario Faggioli
  2014-02-25  1:36       ` confusions on monitoring VM cpu usage inXenhypervisor Charles
  0 siblings, 1 reply; 5+ messages in thread
From: Dario Faggioli @ 2014-02-24 17:06 UTC (permalink / raw)
  To: Charles; +Cc: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 2384 bytes --]

[please, don't drop the list. Re-added]

On lun, 2014-02-24 at 10:30 +0800, Charles wrote:
> Thanks for your reply. 
> 1.The VM usage I mean here is similar to the result of command top in the VM. 
>
Ok, but still, when running top inside the VM, which part are you
interested in? How busy the various vCPUs are or what (as in what
process/OS component) is actually keeping the busy?

That matters because, how busy they are is something that you, to some
extent, see in Xen, as it is at lest bound to how much he various vCPUs
want to run on the host's pCPUs, and that's the hypervisor's scheduler's
job!

If you want to know what process they're running, at what time that
started, etc., what's the "priority" (inside the VM) then this is
something I don't think you can easily have Xen aware of, unless you
introduce some kind of scheduler paravirtualization.

> 2."use the usage information in Credit" means I want to use the usage information to guess the workload type running in the VM
> 
Still too few info (see above). xentop tells already whether a
particular vCPU is getting, say, 5% of pCPU time. Have something like
that inside Xen should not be that hard.

What it does not (xentop) tell is whether a particular vCPU, despite
getting 5%, is asking for more, and only getting that for whatever
reason. That has to do with the estimation of the system load that I was
mentioning, which is embedded in credit2 right now, but can be
generalized.

So, which one, if any, of the above are you after?

> To the best of my knowledge, when in physical OS, the CPU may be idle or busy. Then the OS CPU usage can be computed by (busy_time / (idle_time + busy_time))
> If the vCPU is running the on pCPU and it's consuming pCPU cycles all the time, then is it mean  idle_time = 0? then how to I compute the CPU usage?
> 
Err... from Xen's perspective, if a vCPU is always running, then
idle_time=0, then (busy_time/(idle_time+busy_time))=1, which matches
with the concept of being "always running".

I'm sure I'm missing something of what you meant here...

Regards,
Dario

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: confusions on monitoring VM cpu usage inXenhypervisor
  2014-02-24 17:06     ` confusions on monitoring VM cpu usage in Xenhypervisor Dario Faggioli
@ 2014-02-25  1:36       ` Charles
  0 siblings, 0 replies; 5+ messages in thread
From: Charles @ 2014-02-25  1:36 UTC (permalink / raw)
  To: xen-devel

1. I want the  CPU usage information like this:

Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st

2. From the VM's perspective, I want to make it out what's the sum of busy_time and idle_time, 
According to my understanding, I think when a vCPU is scheduled on pCPU,  from the perspective of vCPU, its (busy_time +idle_time) equals to 
the percentage of CPU it gets from the hypervisor (because I think when scheduled on a pCPU, the scenario is like a physical OS running, contains 
both busy_time and idle_time ), Then how could I know the busy_time of a vCPU from VM's perspective, since you have noted that if a vCPU is scheduled on pCPU, it keeps 
consuming CPU cycles?

[please, don't drop the list. Re-added]

On lun, 2014-02-24 at 10:30 +0800, Charles wrote:
> Thanks for your reply. 
> 1.The VM usage I mean here is similar to the result of command top in the VM. 
>
Ok, but still, when running top inside the VM, which part are you
interested in? How busy the various vCPUs are or what (as in what
process/OS component) is actually keeping the busy?

That matters because, how busy they are is something that you, to some
extent, see in Xen, as it is at lest bound to how much he various vCPUs
want to run on the host's pCPUs, and that's the hypervisor's scheduler's
job!

If you want to know what process they're running, at what time that
started, etc., what's the "priority" (inside the VM) then this is
something I don't think you can easily have Xen aware of, unless you
introduce some kind of scheduler paravirtualization.

> 2."use the usage information in Credit" means I want to use the usage information to guess the workload type running in the VM
> 
Still too few info (see above). xentop tells already whether a
particular vCPU is getting, say, 5% of pCPU time. Have something like
that inside Xen should not be that hard.

What it does not (xentop) tell is whether a particular vCPU, despite
getting 5%, is asking for more, and only getting that for whatever
reason. That has to do with the estimation of the system load that I was
mentioning, which is embedded in credit2 right now, but can be
generalized.

So, which one, if any, of the above are you after?

> To the best of my knowledge, when in physical OS, the CPU may be idle or busy. Then the OS CPU usage can be computed by (busy_time / (idle_time + busy_time))
> If the vCPU is running the on pCPU and it's consuming pCPU cycles all the time, then is it mean  idle_time = 0? then how to I compute the CPU usage?
> 
Err... from Xen's perspective, if a vCPU is always running, then
idle_time=0, then (busy_time/(idle_time+busy_time))=1, which matches
with the concept of being "always running".

I'm sure I'm missing something of what you meant here...

Regards,
Dario

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

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

end of thread, other threads:[~2014-02-25  1:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-20  8:09 confusions on monitoring VM cpu usage in Xen hypervisor =?gb18030?B?Q2hhcmxlcw==?=
2014-02-21 17:42 ` Dario Faggioli
     [not found]   ` <tencent_1F08A5736F1E5981265AE0C8@qq.com>
2014-02-24 17:06     ` confusions on monitoring VM cpu usage in Xenhypervisor Dario Faggioli
2014-02-25  1:36       ` confusions on monitoring VM cpu usage inXenhypervisor Charles
2014-02-21 22:19 ` confusions on monitoring VM cpu usage in Xen hypervisor Mukesh Rathor

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.