Richard W.M. Jones
2007-Aug-06 21:15 UTC
[Fedora-xen] ANNOUNCE: Virt-top - a top-like utility for displaying virtualization stats
I''m pleased to announce the first release of virt-top, which is a top-like utility for displaying virtualization stats. It aims to look and feel very much like regular ''top'', so as to be as familiar as possible for systems administrators. You can also use it as a pleasant replacement for xentop. It uses libvirt, so can display stats across a variety of different hypervisors and virtualization systems (not just Xen, although that is where the testing has gone so far). http://et.redhat.com/~rjones/virt-top/ The license is a combination of LGPL (for the library) and GPL (for the virt-top program). Current status -------------- You can view domains and use familiar keys like ''P''/''M''/... to sort by processor/memory/..., and ''d''/''s'' to set the delay between updates. Also some common top command-line options are implemented. The man page is here: http://et.redhat.com/~rjones/virt-top/virt-top.txt There are a variety of source and binary RPMs available for Fedora users. I don''t yet have a working Debian/Ubuntu package, but will have a go at making one tomorrow. The next thing I''ll be working on is showing virtual and physical CPU usage of guests. After that I''m hoping to discuss extensions to libvirt to make other interesting statistics available to virt-top, in particular disk and network I/O stats. There are a few data collection artifacts which need to be investigated. In particular, %CPU sometimes goes over 100%. Obviously accurate data collection is an important goal for this tool. Memory usage is good: typical ''RES'' (in regular top) for virt-top is just under 2.5 MB, and I''ve had it running for hours at a time without memory usage increasing, which seems to indicate that there aren''t any major memory leaks. Development ----------- The program is currently very small: exactly 500 lines of code! If you want to dive in and send me patches they are most welcome, but remember that I''m trying to make this utility act as much like ''top'' as possible, so if ''top'' does it in a particular way, then I''d prefer virt-top to do the same thing. (May not apply to obscure top functionality, if top does something silly). If you''re a systems administrator, not a programmer, and you''d like virt-top to have some particular feature, then please let me know, and I will be happy to review it and code it for you. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903
Daniel P. Berrange
2007-Aug-06 21:31 UTC
[Fedora-xen] Re: [Libvir] ANNOUNCE: Virt-top - a top-like utility for displaying virtualization stats
On Mon, Aug 06, 2007 at 10:15:48PM +0100, Richard W.M. Jones wrote:> There are a few data collection artifacts which need to be investigated. > In particular, %CPU sometimes goes over 100%. Obviously accurate data > collection is an important goal for this tool.AFAICT it is impossible to stop it going over 100% - we have same issue in virt-manager when calculating CPU usage. To caculate the % usage you are looking at the differential between CPU time from two calls to virDomainGetInfo vs the time period between two gettimeofday() calls. If the time delta between your gettimeofday() calls does not exactly match the time delta between your virDomainGetInfo() calls, and the domain you''re measuring is very active then you can end up calcuating> 100% occassionally. Not by much - typically < 1% over, but I don''treally see any way around it. Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
Tom Horsley
2007-Aug-06 23:18 UTC
Re: [Fedora-xen] Re: [Libvir] ANNOUNCE: Virt-top - a top-like utility for displaying virtualization stats
On Mon, 6 Aug 2007 22:31:24 +0100 "Daniel P. Berrange" <berrange@redhat.com> wrote:> If the time delta between your gettimeofday() calls does not exactly > match the time delta between your virDomainGetInfo() calls, and the > domain you''re measuring is very active then you can end up calcuating > > 100% occassionally. Not by much - typically < 1% over, but I don''t > really see any way around it.Shucks, it is easy to work around: if (percentcpu > 100) percentcpu = 100; :-).
Daniel P. Berrange
2007-Aug-07 03:33 UTC
Re: [Fedora-xen] Re: [Libvir] ANNOUNCE: Virt-top - a top-like utility for displaying virtualization stats
On Mon, Aug 06, 2007 at 07:18:35PM -0400, Tom Horsley wrote:> On Mon, 6 Aug 2007 22:31:24 +0100 > "Daniel P. Berrange" <berrange@redhat.com> wrote: > > > If the time delta between your gettimeofday() calls does not exactly > > match the time delta between your virDomainGetInfo() calls, and the > > domain you''re measuring is very active then you can end up calcuating > > > 100% occassionally. Not by much - typically < 1% over, but I don''t > > really see any way around it. > > Shucks, it is easy to work around: > > if (percentcpu > 100) percentcpu = 100;When I said "i don''t see any way around it" I meant a way which would be calculating correct/accurate figures. Clamping to 100% is just pretending the problem doesn''t exist - though it is the hack I am already using in virt-manager. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
Richard W.M. Jones
2007-Aug-09 14:31 UTC
[Fedora-xen] ANNOUNCE: Virt-top 0.3.1.5 - a top-like utility for displaying virtualization stats
There is a significantly updated version of virt-top now available. On systems which support it, you can show the mapping of domains to physical CPUs and the amount of each physical CPU being used. Screenshots: http://et.redhat.com/~rjones/virt-top/screenshots.html There are also binaries available to download for i386 and x86-64. (The binaries are just self-contained Linux executables, no extra files or dependencies are needed, except for libvirt.so). Downloads: http://et.redhat.com/~rjones/virt-top/download.html If you are a systems administrator, what do you think could be improved about virt-top? Try it out and let me have your suggestions ... Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903
Richard W.M. Jones
2007-Aug-20 12:38 UTC
Re: [Fedora-xen] ANNOUNCE: Virt-top 0.3.1.5 - a top-like utility for displaying virtualization stats
Andy Burns wrote:> On 09/08/07, Richard W.M. Jones <rjones@redhat.com> wrote: > >> There is a significantly updated version of virt-top now available. On >> systems which support it, you can show the mapping of domains to >> physical CPUs and the amount of each physical CPU being used. > > I downloaded the binary 64bit version and ran it on a fedora 7 xen > host without any problems, the host is a dual-core xeon andnoticed > the CPU% reporting works differently compared to xentop, I assume this > is deliberate?Thanks for trying this! I was on holiday last week, hence the late reply.> virt-top seems to report each domain''s usage as a percentage of all > the sum of all CPUs, where xentop seems to report the percentages in > terms of a single CPU. > > e.g. on xentop may show dom0 taking 102% and my domU taking 24%, while > virt-top will shows this as 51% and 12% respectively, which seems more > logical.Yes, this is deliberate. We wanted to make it work like virt-manager and plain top. Notice that xentop is the exception in this regard. Rich. PS: I will be making available proper binaries for RHEL, Fedora, CentOS and Debian, i386 & x86-64, this week. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903