XenMon的使用

来源:互联网 发布:java适配器模式 编辑:程序博客网 时间:2024/06/18 11:25
It is important to keep in mind that Xen is an enterprise level environment capable of supporting complex virtualization configurations. As with any complex system it would be naive to assume that the system will run without the occasional performance issues or problem. Deploying Xen virtualization therefore requires an understanding of the tools and techniques necessary to monitor the running environment, identify performance issues and track down problems.

Obtaining Xen Configuration and System Information

Perhaps the most basic step in monitoring a Xen system or isolating a problem is to get a high level overview of the Xen environment and underlying configuration. This information will be of particular importance when requesting help from a vendor or forum. A good way to obtain this information is to use the xm info command. For example, the following example shows output from xl info on a Red Hat Enterprise Linux 5 (RHEL5) system:

xl infohost                   : localhost.localdomainrelease                : 2.6.18-53.el5xenversion                : #1 SMP Wed Oct 10 17:06:12 EDT 2007machine                : i686nr_cpus                : 1nr_nodes               : 1sockets_per_node       : 1cores_per_socket       : 1threads_per_core       : 1cpu_mhz                : 2993hw_caps                : 0febfbff:20100000:00000000:00000180:0000a015:00000000:00000001total_memory           : 255free_memory            : 14xen_major              : 3xen_minor              : 1xen_extra              : .0-53.el5xen_caps               : xen-3.0-x86_32p xen_pagesize           : 4096platform_params        : virt_start=0xf5800000xen_changeset          : unavailablecc_compiler            : gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)cc_compile_by          : brewbuildercc_compile_domain      : build.redhat.comcc_compile_date        : Wed Oct 10 16:30:55 EDT 2007xend_config_format     : 2

Monitoring Xen Performance with XenMon

The XenMon tool is useful for monitoring the performance Xen domains, particularly when identifying which domains are responsible for the highest I/O or processing loads on a system.

XenMon is started from the command-line using the xenmon.py command. The following figure shows a typical XenMon session:

The XenMon display shows two sets of data. On the left hand side are statistics captured over the preceding 10 seconds and on the right is the data for the last 1 second.

For each domain three sets of data are provided. The first row (the grammatically dubious Gotten) for each domain is the amount of time the domain as spent executing. The Blocked row shows statistics for idle time. Finally, the Waited row indicates the amount of time the domain has been in a wait state. For each category the amount of time spent in the particular mode and the time as a percentage of overall time during the corresponding period (i.e 1 or 10 seconds) is displayed. The final value depends on the category. For Gotten this represents processor time, for Blocked the average blocked time and for Wait the average waiting time.

By default XenMon displays information for CPU 0. If the system has more than one physical CPU then the p and n keys can be used to page through the data for each CPU on the system.

When XenMon is exited (using the q key) a summary of data collected during the monitoring session is displayed:

ms_per_sample = 100Initialized with 1 cpuCPU Frequency = 2993.98Event counts:00000000        Other00000000        Add Domain00000000        Remove Domain00000000        Sleep00022838        Wake00022838        Block00045666        Switch00000000        Timer Func00045666        Switch Prev00045666        Switch Next00000000        Page Map00000000        Page Unmap00000000        Page Transferprocessed 182674 total records in 288 seconds (634 per second)woke up 288 times in 288 seconds (1 per second)

XenMon accepts a range of command-line options which control various aspects of the monitoring. For a breakdown of these options simply pass the --help argument through to xenmon.py:
xenmon.py --helpusage: xenmon.py [options]options:  -h, --help            show this help message and exit  -l, --live            show the ncurses live monitoring frontend (default)  -n, --notlive         write to file instead of live monitoring  -p PREFIX, --prefix=PREFIX                        prefix to use for output files  -t DURATION, --time=DURATION                        stop logging to file after this much time has elapsed                        (in seconds). set to 0 to keep logging indefinitely  -i INTERVAL, --interval=INTERVAL                        interval for logging (in ms)  --ms_per_sample=MSPERSAMPLE                        determines how many ms worth of data goes in a sample  --cpu=CPU             specifies which cpu to display data for  --allocated           Display allocated time for each domain  --noallocated         Don't display allocated time for each domain  --blocked             Display blocked time for each domain  --noblocked           Don't display blocked time for each domain  --waited              Display waiting time for each domain  --nowaited            Don't display waiting time for each domain  --excount             Display execution count for each domain  --noexcount           Don't display execution count for each domain  --iocount             Display I/O count for each domain  --noiocount           Don't display I/O count for each domain


参考自:http://www.virtuatopia.com/index.php/Xen_Monitoring_Tools_and_Techniques




原创粉丝点击