码迷,mamicode.com
首页 > 移动开发 > 详细

iostat

时间:2017-05-01 09:48:41      阅读:290      评论:0      收藏:0      [点我收藏+]

标签:cpu   sector   模式   res   参数   容量   操作   利用   x86   

iostat

Usage: iostat [ options ] [ <interval> [ <count> ] ]
iostat - Report Central Processing Unit (CPU) statistics and input/output statistics for devices, partitions and network filesystems (NFS). Linux系统中的 iostat是I/O statistics(输入/输出统计)的缩写,iostat工具将对系统的磁盘操作活动进行监视。 它的特点是汇报磁盘活动统计情况,同时也会汇报出CPU使用情况。 同vmstat一样,iostat也有一个弱点,就是它不能对某个进程进行深入分析,仅对系统的整体情况进行分析。 iostat属于sysstat软件包,可以用yum install sysstat 直接安装。

常用参数

-c 显示CPU使用情况
-d 显示磁盘使用情况
-k 以 KB为单位显示
-m 以 M 为单位显示    
-N 显示磁盘阵列(LVM) 信息
-n 显示NFS 使用情况    
-p 显示磁盘和分区的情况    
-t 显示终端和CPU的信息
-x 显示详细信息    

 

使用实例,查看CPU及DISK负载

[root@node85 ~]# iostat 
Linux 2.6.32-573.el6.x86_64 (node85)    02/01/2017      _x86_64_        (1 CPU)
【iostst -c 】
avg
-cpu: %user %nice %system %iowait %steal %idle 0.03 0.01 0.28 0.54 0.00 99.14 【iostat -d 】 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn sda 1.68 42.37 4.47 193056 20346 scd0 0.01 0.08 0.00 352 0

%user:CPU处在用户模式下的时间百分比。
%nice:CPU处在带NICE值的用户模式下的时间百分比。
%system:CPU处在系统模式下的时间百分比。
%iowait:CPU等待输入输出完成时间的百分比。
%steal:管理程序维护另一个虚拟处理器时,虚拟CPU的无意识等待时间百分比。
%idle:CPU空闲时间百分比。
备注:如果%iowait的值过高,表示硬盘存在I/O瓶颈
      %idle值高,表示CPU较空闲,如果%idle值高但系统响应慢时,有可能是CPU等待分配内存,此时应加大内存容量
      %idle值如果持续低于10,那么系统的CPU处理能力相对较低,表明系统中最需要解决的资源是CPU


tps:   每秒进程下发的IO读、写请求数量.该设备每秒的传输次数(Indicate the number of transfers per second that were issued to the device.)。
    “一次传输”意思是“一次I/O请求”。多个逻辑请求可能会被合并为“一次I/O请求”。“一次传输”请求的大小是未知的
Blk_read/s: Indicate  the  amount  of  data  read  from  the   device expressed  in  a  number of blocks per second
Blk_wrtn/s: Indicate  the  amount  of  data  written  to  the  device expressed in a number of blocks per second.
Blk_read: The total number of blocks read.
Blk_wrtn: The total number of blocks written.
==>Blocks are equivalent to sectors with  kernels  2.4  and  later  and therefore have a size of 512 bytes

 

[root@node85 ~]# iostat -d
Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
sda               1.08        26.32         3.14     193056      23018
scd0              0.01         0.05         0.00        352          0
[root@node85 ~]# iostat -d -k
Device:            tps    kB_read/s            kB_wrtn/s    kB_read    kB_wrtn
sda               1.07        13.11(26.32*512/1024)     1.57      96528      11589
scd0              0.01         0.02         0.00        176          0

 

[root@node85 ~]# iostat -d  -k  -x
Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await  svctm  %util
sda               0.41     0.22    0.79    0.14    11.19     1.45    27.03     0.01    5.78   4.29   0.40
scd0              0.00     0.00    0.01    0.00     0.02     0.00     8.00     0.00    1.93   1.93   0.00

rrqm/s:每秒被合并的读请求数
wrqm/s:每秒被合并的写请求数
r/s :每秒的读请求数
w/s :每秒的写请求数
rsec/s:每秒读取的扇区数
wsec/s:每秒写入的扇区数
rkB/s:每秒从设备读取的数据量(单位:KB)
wkB/s:每秒写入设备的数据量(单位:KB)
rMB/s:每秒从设备读取的数据量(单位:MB)
wMB/s:每秒写入设备的数据量(单位:MB)
avgrq-sz :平均每次IO操作的数据量(扇区数为单位)
avgqu-sz:平均等待处理的IO请求队列长度  
await:I/O请求等待时间的平均值(单位:毫秒)
svctm:I/O请求处理时间的平均值(单位:毫秒)
%util:消耗在I/O请求中的CPU时间百分比(设备带宽利用率)。如果该值接近100%说明设备出现了瓶颈

 

iostat

标签:cpu   sector   模式   res   参数   容量   操作   利用   x86   

原文地址:http://www.cnblogs.com/gtms/p/6742427.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!