Hello, all. I''ve done some googling and searching the Xen User archives but don''t see how to measure overall CPU utilization. We are using Xen more and more in production and have some hosts with a large number of domUs. How do I know when the CPU is starting to be fully utilized before the users start complaining about performance? Thanks - John -- John A. Sullivan III Open Source Development Corporation +1 207-985-7880 jsullivan@opensourcedevel.com If you would like to participate in the development of an open source enterprise class network security management system, please visit http://iscs.sourceforge.net _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Quoting "John A. Sullivan III" <jsullivan@opensourcedevel.com>:> Hello, all. I''ve done some googling and searching the Xen User > archives but don''t see how to measure overall CPU utilization. > > We are using Xen more and more in production and have some hosts with > a large number of domUs. How do I know when the CPU is starting to > be fully utilized before the users start complaining about > performance? >Run `xm top` in the dom0, it shows cpu usage in all active domains. Cheers, Peter _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
John A. Sullivan III
2006-Apr-26 19:24 UTC
Re: [Xen-users] Measuring overall CPU utlization
On Wed, 2006-04-26 at 21:03 +0200, Peter Fokkinga wrote:> Quoting "John A. Sullivan III" <jsullivan@opensourcedevel.com>: > > Hello, all. I''ve done some googling and searching the Xen User > > archives but don''t see how to measure overall CPU utilization. > > > > We are using Xen more and more in production and have some hosts with > > a large number of domUs. How do I know when the CPU is starting to > > be fully utilized before the users start complaining about > > performance? > > > > Run `xm top` in the dom0, it shows cpu usage in all active domains. > > Cheers, Peter<snip> I''m sorry; I should have specified that I am running Xen 2.0.7. I do not see or have a xm top command. What do I do in 2.0.7? Thanks - John -- John A. Sullivan III Open Source Development Corporation +1 207-985-7880 jsullivan@opensourcedevel.com Financially sustainable open source development http://www.opensourcedevel.com _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> <snip> > I''m sorry; I should have specified that I am running Xen 2.0.7. I do > not see or have a xm top command. What do I do in 2.0.7?This works for me in Xen 2.0.7 (or you can write a wrapper around ''xm list''). This is not guaranteed to be correct/accurate -- you at your own risk :-) : ===================================import sys import curses import curses.ascii import time sys.path.append(''/usr/lib/python'') import xen.lowlevel.xc xc = xen.lowlevel.xc.new() # initialize curses stdscr = curses.initscr() curses.noecho() curses.cbreak() stdscr.keypad(1) # timeout getch after 1s stdscr.timeout(1000) (maxy, maxx) = stdscr.getmaxyx() vtop_start = time.time() first_run = True shares = {} while True: # sleep for 1 second # between outputs dlist = xc.domain_getinfo() idx = 1 cpusum=0 if first_run: for d in dlist: shares[d[''dom'']] = d[''cpu_time''] first_run = False else: for d in dlist: now = time.time() share = d[''cpu_time''] - shares[d[''dom'']] p = (share*100)/((now - vtop_start) * 10**9) cpusum+=p stdscr.addstr(idx, 1, "%d\t\t%d\t\t%.2f" % (d[''dom''], d[''cpu''], p)) idx += 1 stdscr.addstr(idx, 1, "\t\t\t\t%.2f" % cpusum) idx += 1 c = stdscr.getch() # quit on q if c == ord(''q''): break stdscr.erase() stdscr.refresh() curses.nocbreak() stdscr.keypad(0) curses.echo() curses.endwin() ==========================================-- Web/Blog/Gallery: http://floatingsun.net/blog _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
John A. Sullivan III
2006-Apr-26 22:27 UTC
Re: [Xen-users] Measuring overall CPU utlization
On Wed, 2006-04-26 at 14:07 -0700, Diwaker Gupta wrote:> > <snip> > > I''m sorry; I should have specified that I am running Xen 2.0.7. I do > > not see or have a xm top command. What do I do in 2.0.7? > > This works for me in Xen 2.0.7 (or you can write a wrapper around ''xm > list''). This is not guaranteed to be correct/accurate -- you at your > own risk :-) : > > ===================================> import sys > import curses > import curses.ascii > import time > > sys.path.append(''/usr/lib/python'') > import xen.lowlevel.xc > > xc = xen.lowlevel.xc.new() > > # initialize curses > stdscr = curses.initscr() > curses.noecho() > curses.cbreak() > stdscr.keypad(1) > > # timeout getch after 1s > stdscr.timeout(1000) > > (maxy, maxx) = stdscr.getmaxyx() > > vtop_start = time.time() > first_run = True > > shares = {} > while True: > # sleep for 1 second > # between outputs > dlist = xc.domain_getinfo() > idx = 1 > cpusum=0 > if first_run: > for d in dlist: > shares[d[''dom'']] = d[''cpu_time''] > first_run = False > else: > for d in dlist: > now = time.time() > share = d[''cpu_time''] - shares[d[''dom'']] > p = (share*100)/((now - vtop_start) * 10**9) > cpusum+=p > stdscr.addstr(idx, 1, "%d\t\t%d\t\t%.2f" % (d[''dom''], d[''cpu''], p)) > idx += 1 > > stdscr.addstr(idx, 1, "\t\t\t\t%.2f" % cpusum) > idx += 1 > c = stdscr.getch() > # quit on q > if c == ord(''q''): > break > stdscr.erase() > stdscr.refresh() > > curses.nocbreak() > stdscr.keypad(0) > curses.echo() > curses.endwin()<snip> That looks like it''s working. Thanks! - John -- John A. Sullivan III Open Source Development Corporation +1 207-985-7880 jsullivan@opensourcedevel.com Financially sustainable open source development http://www.opensourcedevel.com _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
I notice that the xentop and xenmon tools do not try to combine the CPU usage of an unpriveliged domain with the CPU usage done by dom0 on its behalf for IO. Has any work been done for determining the "total" CPU usage of each unpriveliged domain? For example, I may have an application running on a VM which is very IO intensive. As a result, its CPU allocation may be very low, but dom0 will be doing quite a bit of work on its behalf. Presumably this could be estimated to some degree by looking at the number of IO exchanges as reported by xenmon, but it seems like there should be a more precise way. any suggestions or pointers? thanks -Tim On 4/26/06, John A. Sullivan III <jsullivan@opensourcedevel.com> wrote:> > On Wed, 2006-04-26 at 14:07 -0700, Diwaker Gupta wrote: > > > <snip> > > > I''m sorry; I should have specified that I am running Xen 2.0.7. I do > > > not see or have a xm top command. What do I do in 2.0.7? > > > > This works for me in Xen 2.0.7 (or you can write a wrapper around ''xm > > list''). This is not guaranteed to be correct/accurate -- you at your > > own risk :-) : > > > That looks like it''s working. Thanks! - John > -- > John A. Sullivan III > Open Source Development Corporation > +1 207-985-7880 > jsullivan@opensourcedevel.com > > Financially sustainable open source development > http://www.opensourcedevel.com > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hi Tim, On 4/27/06, Tim Wood <twwood@gmail.com> wrote:> I notice that the xentop and xenmon tools do not try to combine the CPU > usage of an unpriveliged domain with the CPU usage done by dom0 on its > behalf for IO. Has any work been done for determining the "total" CPU usage > of each unpriveliged domain? For example, I may have an application running > on a VM which is very IO intensive. As a result, its CPU allocation may be > very low, but dom0 will be doing quite a bit of work on its behalf. > Presumably this could be estimated to some degree by looking at the number > of IO exchanges as reported by xenmon, but it seems like there should be a > more precise way.I can tell you that this problem is being looked at. Some preliminary work was done in [1] which used I/O exchanges and there have been some follow up efforts since then. IMHO, there''s no efficient way of directly accounting work in dom0 -- you need to work with heuristics. [1] http://www.hpl.hp.com/personal/Lucy_Cherkasova/papers/final-perf-study-usenix.pdf -- Web/Blog/Gallery: http://floatingsun.net/blog _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hi, >> I notice that the xentop and xenmon tools do not try to combine the >> CPU usage of an unpriveliged domain with the CPU usage done by dom0 >> on its behalf for IO. Has any work been done for determining the >> "total" CPU usage of each unpriveliged domain? I don''t know, but it also would be very interesting for me! >> For example, I may have an application running on a VM which is very >> IO intensive. As a result, its CPU allocation may be very low, but >> dom0 will be doing quite a bit of work on its behalf. >> Presumably this could be estimated to some degree by looking at the >> number of IO exchanges as reported by xenmon, but it seems like there >> should be a more precise way. Do you mean this value "0.02/ex I/O Count" ? If so, what is the range of this value, I made some tests with dd, netio, stress and others and got values between 0/ex and 11/ex but I don''t have any idea what is little, what is much and what is too much (like 99% CPU load). How can I generate correct load for IO? > I can tell you that this problem is being looked at. Some preliminary > work was done in [1] which used I/O exchanges and there have been some > follow up efforts since then. IMHO, there''s no efficient way of I''ve read this article, they explained how they measure it with Xen 2.0 but there is no code available and even if so it would not work with Xen 3.0. So, is it possible to use the output of xenmon.py to monitor the IO-load of a system for example to use it as a condition for loadbalancing? I''m using already some output of xenmon.py for measuring the CPU-load, so it would be nice if I could add also the IO-load to it! Thanks a lot for your answers, -- Chau y hasta luego, Thorolf _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users