是在sun网站上看到的,原文是e文,连接如下:
http://www.adminschoice.com/docs/iostat_vmstat_netstat.htm
大概翻译了一下,总觉得好像以前哪位大大贴过类似的
不管了,觉得有点用,大家一起看看
翻译得不好,见笑了……如果有错,请指正哦,先谢了
[b:38a037c632]Input Output statistics ( iostat )[/b:38a037c632]
iostat反映了终端、磁盘I/O情况和CPU活动。输出结果的第一行是从系统启动到现在为止的这段时间的结果,接下去的每一行是interval时
间段内的结果。Kernel里有一组计数器用来跟踪这些值。
iostat的默认参数是tdc(terminal, disk, and CPU)。如果任何其他的选项被指定,这个默认参数将被完全替代,例如,iostat -d将只反
映磁盘的统计结果。
语法:
基本语法: iostat <options> interval count
option - 让你指定所需信息的设备,像磁盘、cpu或者终端(-d , -c , -t or -tdc ) 。x 选项给出了完整的统计结果(gives the extended
statistic)。
interval - 在两个samples之间的时间(秒)。
count - 就是需要统计几次
例子:
$ iostat -xtc 5 2
extended disk statistics tty cpu
disk r/s w/s Kr/s Kw/s wait actv svc_t %w %b tin tout us sy wt id
sd0 2.6 3.0 20.7 22.7 0.1 0.2 59.2 6 19 0 84 3 85 11 0
sd1 4.2 1.0 33.5 8.0 0.0 0.2 47.2 2 23
sd2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
sd3 10.2 1.6 51.4 12.8 0.1 0.3 31.2 3 31
The fields have the following meanings:
disk name of the disk
r/s reads per second
w/s writes per second
Kr/s kilobytes read per second
Kw/s kilobytes written per second
wait average number of transactions waiting for service (Q length)
actv average number of transactions actively
being serviced (removed from the
queue but not yet
completed)
%w percent of time there are transactions waiting
for service (queue non-empty)
%b percent of time the disk is busy (transactions
in progress)
Results and Solutions:
从iostat输出结果中需要注意的值:
Reads/writes per second (r/s , w/s)
Percentage busy (%b)
Service time (svc_t)
如果磁盘显示长时间的高reads/writes,并且磁盘的percentage busy (%b)也远大于5%,同时average service time (svc_t)也远大于30
milliseconds,这以下的措施需要被执行:
1.)调整应用,令其使用磁盘i/o更加有效率,可以通过修改磁盘队列、使用应用服务器的cache
2.)将文件系统分布到2个或多个磁盘上,并使用volume manager/disksuite的条带化特点
3.) 增加系统参数值,如inode cache , ufs_ninode。Increase the system parameter values for inode cache , ufs_ninode , which