分类: LINUX
2011-02-06 23:10:34
Top 是 Unix/Linux 中监测性能的重要工具,Xen 中也有 top,用来监测 host 和各 domains 的实时状态:
# xm top xentop - 20:48:24 Xen 3.1.2-164.11.1.el5 10 domains: 2 running, 8 blocked, 0 paused, 0 crashed, 0 dying, 0 shutdown Mem: 8388156k total, 7617344k used, 770812k free CPUs: 2 @ 2814MHz NAME STATE CPU(sec) CPU(%) MEM(k) MEM(%) MAXMEM(k) MAXMEM(%) VCPUS NETS NETTX(k) NETRX(k) VBDS VBD_OO VBD_RD VBD_WR S SID Domain-0 -----r 1478 2.6 524412 6.3 no limit n/a 2 6 648948 66380 0 0 0 0 0 vm01 --b--- 194 0.2 532352 6.3 540672 6.4 1 1 0 0 1 0 0 0 0 vm02 --b--- 211 0.2 532352 6.3 540672 6.4 1 1 0 0 1 0 0 0 0 vm03 -----r 1685 106.4 1048440 12.5 1048576 12.5 2 1 26384 26900 2 0 6751 21520 0 vm04 --b--- 5255 20.6 2105216 25.1 2113536 25.2 1 1 0 0 1 0 0 0 0 ...
显示所有 domains 的运行状态信息:
# xm list Name ID Mem(MiB) VCPUs State Time(s) Domain-0 0 512 2 r----- 1457.3 vm01 1 519 1 -b---- 191.9 vm02 2 519 1 -b---- 208.9 vm03 8 1023 2 -b---- 1666.1 vm04 9 2055 1 -b---- 5100.9 ...
显示所有 domains 的上线时间:
# xm uptime Name ID Uptime Domain-0 0 20:30:40 vm01 1 20:28:54 vm02 2 20:28:48 vm03 8 7:44:07 vm04 9 20:28:34 ...
显示 host 的信息:
# xm info
显示所有 domains 使用虚拟处理器的情况:
# xm vcpu-list Name ID VCPUs CPU State Time(s) CPU Affinity Domain-0 0 0 0 r-- 1392.3 0 Domain-0 0 1 1 -b- 80.5 1 vm01 1 0 1 -b- 194.1 any cpu vm02 2 0 1 -b- 210.6 any cpu vm03 8 0 1 -b- 901.8 any cpu vm03 8 1 1 -b- 770.8 any cpu vm04 9 0 0 -b- 5211.0 any cpu
显示某个 domain 使用的虚拟网卡信息:
# xm network-list vm01 Idx BE MAC Addr. handle state evt-ch tx-/rx-ring-ref BE-path 0 0 00:16:3e:24:c4:0b 0 4 12 768 /769 /local/domain/0/backend/vif/10/0
显示 xend 的日志:
# xm log
显示 xend 的 demsg 信息:
# xm dmesg
显示 host(node)的信息,和 xm info 类似:
# virsh nodeinfo CPU model: x86_64 CPU(s): 2 CPU frequency: 2814 MHz CPU socket(s): 1 Core(s) per socket: 2 Thread(s) per core: 1 NUMA cell(s): 1 Memory size: 8387584 kB
显示某个 domain 的相关信息:
# virsh dominfo vm01 Id: 1 Name: vm01 UUID: 8636724a-0369-4d18-ab92-969ad3a21bf6 OS Type: hvm State: idle CPU(s): 1 CPU time: 2992.5s Max memory: 540672 kB Used memory: 532352 kB Autostart: enable
显示某个 domain 使用的虚拟处理器信息:
# virsh vcpuinfo vm01 VCPU: 0 CPU: 1 State: idle CPU time: 2989.9s CPU Affinity: yy