有人可以告诉我关于/ proc / diskstats的第11个字段吗? 该文件说,它是加权I / O花费的毫秒数。 是不是像DiskIO一秒钟花费的毫秒数?
我从这个值减去前一个值后每200mslogging一次这个值,并且观察到这个值高达7000.我需要绘制一个显示磁盘IO率的图。 这是脚本:
#!/bin/bash PREV_TOTAL=0 echo "" >> $1 while true; do numbers=( $(tail -3 < /proc/diskstats | head -2 | awk '{print $14}' ) ) ; let "TOTAL=$((${numbers[0]} + ${numbers[1]}))" let "DIFF_TOTAL=$TOTAL-$PREV_TOTAL" time=`date +%s%N` echo "$time $DIFF_TOTAL" >> $1 PREV_TOTAL="$TOTAL" # Wait before checking again. sleep 0.2 done
有人可以解释这个领域?
从文档 :
Field 11 -- weighted # of milliseconds spent doing I/Os This field is incremented at each I/O start, I/O completion, I/O merge, or read of these stats by the number of I/Os in progress (field 9) times the number of milliseconds spent doing I/O since the last update of this field. This can provide an easy measure of both I/O completion time and the backlog that may be accumulating.
这个字段会增加IO所花费的时间乘以正在进行的IO请求的数量,所以它是按活动请求的数量加权的。 它考虑了IO队列的大小。
例如,一台机器在最后一秒不停地执行IO操作,但队列不会超过1个请求的值将为1000.一台机器也在最后一秒不断地执行IO操作,但平均队列长度为10个请求将会有价值10 000。
来自: http : //www.mjmwired.net/kernel/Documentation/iostats.txt
字段11 – 加权input/输出花费的毫秒数:
This field is incremented at each I/O start, I/O completion, I/O merge, or read of these stats by the number of I/Os in progress (field 9) times the number of milliseconds spent doing I/O since the last update of this field. This can provide an easy measure of both I/O completion time and the backlog that may be accumulating.