十三个强大的Linux性能监测工具(4)
时间:2010-08-25 来源:mydear
5、vmstat
vmstat提供了processes, memory, paging, block I/O, traps和CPU的活动状况.
下边是vmstat的输出样式
498)this.style.width=498;" class="fit-image" />
各输出列的含义:
Process
– r: 等待runtime的进程数
– b: 在不可打断的休眠状态下的进程数
Memory
– swpd: 虚拟内存使用量(KB)
– free: 闲置内存使用量(KB)
– buff: 被当做buffer使用的内存量(KB)
Swap
– si: swap到磁盘的内存量(KBps)
– so: 从磁盘swap出去的内存量(KBps)
IO
– bi: Blocks sent to a block device (blocks/s).
– bo: Blocks received from a block device (blocks/s).
System
– in: The number of interrupts per second, including the clock.
– cs: The number of context switches per second.
CPU (these are percentages of total CPU time)
- us: Time spent running non-kernel code (user time, including nice time).
– sy: Time spent running kernel code (system time).
– id: Time spent idle. Prior to Linux 2.5.41, this included IO-wait time.
– wa: Time spent waiting for IO. Prior to Linux 2.5.41, this appeared as zero.
6 sar
sar是Red Hat Enterprise Linux AS发行的一个工具,同时也是Sysstat工具集的命令之一,可以从以下网址下载:http://perso.wanadoo.fr/sebastien.godard/
sar用于收集、报告或者保存系统活动信息。sar由三个应用组成:sar显示数据、sar1和sar2用于收集和保存数据。
使用sar1和sar2,系统能够配置成自动抓取信息和日志,以备分析使用。配置举例:在/etc/crontab中添加如下几行内容
498)this.style.width=498;" class="fit-image" />
同样的,你也可以在命令行方式下使用sar运行实时报告。如图所示:
从收集的信息中,可以得到详细的CPU使用情况(%user, %nice, %system, %idle)、内存页面调度、网络I/O、进程活动、块设备活动、以及interrupts/second
498)this.style.width=498;" class="fit-image" />