五 性能调试---I/O性能分析( 二 )


对结果的分析:

如果某个磁盘的%busy列的值大于50%,则说明该磁盘可能存在瓶颈;

如果某个磁盘的avwait珍的值大于avserv列的值,也说明该磁盘可能存在瓶颈;


利用SAR命令分析缓冲区的活动


通过命令sar -b,我们可以分析系统中的缓冲区的活动情况 。

Report activity for each block device, e.g., disk or tape drive. One line is printed for each device that had activity during the last interval. If no devices were active, a blank line is printed.Each line contains the following data:

bread/s Number of physical reads per second from the disk (or other block devices) to the buffer cache;
bwrit/s: Number of physical writes per second from the buffer cache to the disk (or other block device);
lread/s: Number of reads per second from buffer cache;
lwrit/s: Number of writes per second to buffer cache;
%rcache: Buffer cache hit ratio for read requests e.g., 1 - bread/lread;
%wcache: Buffer cache hit ratio for write requests e.g., 1 - bwrit/lwrit;
pread/s: Number of reads per second from character device using the physio() (raw I/O) mechanism;
pwrit/s: Number of writes per second to character device using the physio() (i.e., raw I/O ) mechanism; mechanism.
对结果的分析:

如果%rcache列的值小于90%,并且%wcache列的值不在70-70%之间,我们必须观察系统中什么应用在做什么样的读/写操作,我们是否需要增加缓冲欧的大小 。


利用SAR命令分析交换区的活动


通过命令sar -w,我们可以分析系统中的交换区的活动情况 。

Report activity for each block device, e.g., disk or tape drive. One line is printed for each device that had activity during the last interval. If no devices were active, a blank line is printed.Each line contains the following data:

swpin/s: Number of process swapins per second;
swpot/s: Number of process swapouts per second;
bswin/s: Number of 512-byte units transferred for swapins per second;
bswot/s: Number of 512-byte units transferred for swapouts per second;
pswch/s: Number of process context switches per second.
对结果的分析:

如果swpin/s的值大于零,那么swpot的值必须引起注意;

同时必须注意pswch/s的值,如果很大,说明进程切换频繁 。



利用GlancePlus分析系统的I/O活动情况


1)对磁盘的整体使用情况的分析:

进入GlancePlus;
按?键进入联机帮助界面;
按d键进入磁盘的详细界面;
按b键表示向后翻页,按f键表示向前翻页;
通过Disk Detail Screen,我们可以知道所有的逻辑和物理I/O请求的分布情况 。

2)对Disk I/O by File System

进入GlancePlus;
按?键进入联机帮助界面;
按i键Disk I/O by File System表界面;
按b键表示向后翻页,按f键表示向前翻页;
这个界面很有用,因为它按不同的文件显示I/O的繁忙程度 。

3)对逻辑卷的分析

进入GlancePlus;
按?键进入联机帮助界面;
按v键I/O by logical volumes表界面;
按b键表示向后翻页,按f键表示向前翻页;
通过把对文件系统的分析和逻辑卷的分析结合起来,能够知道哪个磁盘的I/O最忙 。

4)对磁盘的分析

5)对交换区的分析


GlancePlus


GlancePlus是HP公司的性能分析工具,它是一个联机性能分析和诊断工具,用于监控正在发生的系统活动情况 。它的特点是:

联机性能分析和诊断;
监控系统资源的使用情况;
多屏幕输出;
带有联机帮助;
进程阀值识别和报警,这个阀值可以基于被监控的进程、资源的利用率、用户、进程名或者终端名;
和前面介绍的其他性能分析工具,如:SAR,iostat,vmstat等相比,GlancePlus有一最大好处,这就是:GlancePlus不仅能对系统的整体情况进行分析,而且还可以对某个进程进行深入分析 。

推荐阅读