html tool

2017年2月23日星期四

iostat - spotlight 对应表

参考:
http://linuxcommand.org/man_pages/iostat1.html
---------------------------------------------------
 Device Utilization Report
              The  second report generated by the iostat command is the Device
              Utilization Report. The device report provides statistics  on  a
              per  physical device or partition basis. Block devices for which
              statistics are to be displayed may be  entered  on  the  command
              line. Partitions may also be entered on the command line provid-
              ing that option -x is not used.  If no device nor  partition  is
              entered,  then statistics are displayed for every device used by
              the system, and providing that the kernel  maintains  statistics
              for  it.   If the ALL keyword is given on the command line, then
              statistics are displayed for every device defined by the system,
              including  those that have never been used.  The report may show
              the following fields, depending on the flags used:

              Device:
                     This column gives the device (or partition)  name,  which
                     is  displayed  as  hdiskn  with  2.2 kernels, for the nth
                     device. It is displayed as devm-n with 2.4 kernels, where
                     m  is the major number of the device, and n a distinctive
                     number.  With newer kernels, the device name as listed in
                     the /dev directory is displayed.

              tps
                     Indicate  the  number  of  transfers per second that were
                     issued to the device. A transfer is an I/O request to the
                     device.  Multiple logical requests can be combined into a
                     single I/O request to the device. A transfer is of  inde-
                     terminate size.

              Blk_read/s
                     Indicate the amount of data read from the drive expressed
                     in a number of blocks per second. Blocks  are  equivalent
                     to  sectors with 2.4 kernels and newer and therefore have
                     a size of 512 bytes. With older kernels, a  block  is  of
                     indeterminate size.

              Blk_wrtn/s
                     Indicate   the  amount  of  data  written  to  the  drive
                     expressed in a number of blocks per second.

              Blk_read
                     The total number of blocks read.

              Blk_wrtn
                     The total number of blocks written.

              kB_read/s [popexizhi:spotlight-disk reads chart]
                     Indicate the amount of data read from the drive expressed
                     in  kilobytes  per  second. Data displayed are valid only
                     with kernels 2.4 and newer.

              kB_wrtn/s [popexizhi:splotlight-disk writes chart]
                     Indicate  the  amount  of  data  written  to  the   drive
                     expressed  in  kilobytes  per  second. Data displayed are
                     valid only with kernels 2.4 and newer.

              kB_read
                     The total number of kilobytes read.  Data  displayed  are
                     valid only with kernels 2.4 and newer.

              kB_wrtn
                     The total number of kilobytes written. Data displayed are
                     valid only with kernels 2.4 and newer.

              rrqm/s
                     The number of read requests merged per second  that  were
                     issued to the device.

              wrqm/s
                     The  number of write requests merged per second that were
                     issued to the device.

              r/s [popeixzhi: +w/s 猜测是splotlight-quueue length chart]
                     The number of read  requests  that  were  issued  to  the
                     device per second.

              w/s
                     The  number  of  write  requests  that were issued to the
                     device per second.

              rsec/s
                     The number of sectors read from the device per second.

              wsec/s
                     The number of sectors written to the device per second.

              rkB/s
                     The number of kilobytes read from the device per  second.

              wkB/s
                     The number of kilobytes written to the device per second.

              avgrq-sz
                     The average size (in sectors) of the requests  that  were
                     issued to the device.

              avgqu-sz
                     The average queue length of the requests that were issued
                     to the device.

              await [popexizhi: spotlight- wait time chart]
                     The average  time  (in  milliseconds)  for  I/O  requests
                     issued to the device to be served. This includes the time
                     spent by the requests in queue and the time spent servic-
                     ing them.

              svctm [popexizhi: spotlight- service time]
                     The  average  service  time  (in  milliseconds)  for  I/O
                     requests that were issued to the device.

              %util [popexizhi: spotlight - busy chart]
                     Percentage of CPU time during  which  I/O  requests  were
                     issued  to  the  device  (bandwidth  utilization  for the
                     device). Device saturation  occurs  when  this  value  is
                     close to 100%.


---------------------------------------
http://www.cnblogs.com/peida/archive/2012/12/28/2837345.html

rrqm/s  每秒进行 merge 的读操作数目.即 delta(rmerge)/s 【popexizhi: 合并放入驱动请求队列的读取请求数目】
wrqm/s 每秒进行 merge 的写操作数目.即 delta(wmerge)/s【popexizhi: 合并放入驱动请求队列的写请求数目】
r/s  每秒完成的读 I/O 设备次数.即 delta(rio)/s 【popexizhi: 发送给磁盘设备的读取请求数目,注意区别rrqm/s (请求在发送给设备前已经被合并了)和 (r/s是实际发送给设备的请求数目)】
w/s  每秒完成的写 I/O 设备次数.即 delta(wio)/s 【popexizhi:发送给磁盘设备的写请求数目,注意区别wrqm/s(请求在发送给设备前已经被合并了),这里的rrqm/s,wrqm/s到r/s和w/s的延时就是文件系统为 对读取和写入做的缓冲策略引起的时间差异。
rkB/s  每秒读K字节数.是 rsect/s 的一半,因为每扇区大小为512字节.(需要计算)
wkB/s  每秒写K字节数.是 wsect/s 的一半.(需要计算)
-------------------参见<性能之巅>-P379-----------------------

rsec/s  每秒读扇区数.即 delta(rsect)/s
wsec/s 每秒写扇区数.即 delta(wsect)/s


     avgrq-sz
                     The average size (in sectors) of the requests  that  were
                     issued to the device.
avgrq-sz平均每次设备I/O操作的数据大小 (单位是扇区).delta(rsect+wsect)/delta(rio+wio)
【popexizhi:平均请求大小,单位是扇区(512KB) P380】
      avgqu-sz
                     The average queue length of the requests that were issued

                     to the device.
avgqu-sz平均I/O队列长度.即 delta(aveq)/s/1000 (因为aveq的单位为毫秒).
【popexizhi: avqqu-sz 在驱动请求队列和在设备中活跃的平均请求数 P380】


await [popexizhi: spotlight- wait time chart]
                     The average  time  (in  milliseconds)  for  I/O  requests
                     issued to the device to be served. This includes the time
                     spent by the requests in queue and the time spent servic-

                     ing them.
await  平均每次设备I/O操作的等待时间 (毫秒).即 delta(ruse+wuse)/delta(rio+wio)
【popexizhi: 平均IO响应时间,包括在请求队列中的等待时间和 设备中的服务时间P380
输出性能参数中最重要的指标是await,如果应用程序和文件系统使用了降低写延时的方法(eg: 写穿?what?),w_await 就不如r_await重要了。


  svctm [popexizhi: spotlight- service time]
                     The  average  service  time  (in  milliseconds)  for  I/O
                     requests that were issued to the device.
svctm 平均每次设备I/O操作的服务时间 (毫秒).即 delta(use)/delta(rio+wio)
【popexizhi: (推断)磁盘设备的IO平均响应时间(ms) P380,这里所以说推断因为这个时间是操作系统提供的,这个操作系统是不可见的,只是推断出来的参考P349服务时间介绍。
P380 手册警告,svntm一栏可能因为指标不准确而在以后的版本中移除,我不认为它不准确,但它可能误导人们,以为它是一个推断值而不是设备延时的度量值。


%util 一秒中有百分之多少的时间用于 I/O 操作,或者说一秒中有多少时间 I/O 队列是非空的即 delta(use)/s/1000 (因为use的单位为毫秒)【popexizhi:使用率度量,做容量规划时这个值很重要,但这只是一个繁忙程度的度量(非空闲时间),对后面有多块磁盘支撑的虚拟设备意义不大。】
如果 %util 接近 100%说明产生的I/O请求太多I/O系统已经满负荷该磁盘可能存在瓶颈
idle小于70% IO压力就较大了一般读取速度有较多的wait
同时可以结合vmstat 查看查看b参数(等待资源的进程数)和wa参数(IO等待所占用的CPU时间的百分比高过30%时IO压力高)
另外 await 的参数也要多和 svctm 来参考差的过高就一定有 IO 的问题
avgqu-sz 也是个做 IO 调优时需要注意的地方这个就是直接每次操作的数据的大小如果次数多但数据拿的小的话其实 IO 也会很小如果数据拿的大才IO 的数据会高也可以通过 avgqu-sz × ( r/s or w/s ) = rsec/s or wsec/s也就是讲读定速度是这个来决定的
svctm 一般要小于 await (因为同时等待的请求的等待时间被重复计算了)svctm 的大小一般和磁盘性能有关CPU/内存的负荷也会对其有影响请求过多也会间接导致 svctm 的增加await 的大小一般取决于服务时间(svctm) 以及 I/O 队列的长度和 I/O 请求的发出模式如果 svctm 比较接近 await说明 I/O 几乎没有等待时间;如果 await 远大于 svctm说明 I/O 队列太长应用得到的响应时间变慢如果响应时间超过了用户可以容许的范围这时可以考虑更换更快的磁盘调整内核 elevator 算法优化应用或者升级 CPU
队列长度(avgqu-sz)也可作为衡量系统 I/O 负荷的指标但由于 avgqu-sz 是按照单位时间的平均值所以不能反映瞬间的 I/O 洪水
       形象的比喻
       r/s+w/s 类似于交款人的总数
      平均队列长度(avgqu-sz)类似于单位时间里平均排队人的个数
      平均服务时间(svctm)类似于收银员的收款速度
      平均等待时间(await)类似于平均每人的等待时间
      平均I/O数据(avgrq-sz)类似于平均每人所买的东西多少
       I/O 操作率 (%util)类似于收款台前有人排队的时间比例

       设备IO操作:总IO(io)/s = r/s(读) +w/s(写) =1.46 + 25.28=26.74
      平均每次设备I/O操作只需要0.36毫秒完成,现在却需要10.57毫秒完成,因为发出的 请求太多(每秒26.74个),假如请求时同时发出的,可以这样计算平均等待时间:
      平均等待时间=单个I/O服务器时间*(1+2+...+请求总数-1)/请求总数 
       每秒发出的I/0请求很多,但是平均队列就4,表示这些请求比较均匀,大部分处理还是比较及时

没有评论:

发表评论