iostat
在检测文件系统性能时,经常会使用iostat工具,这个工具可以从设备级别了解磁盘的数据读写。对于和存储性能紧密相关的应用,例如数据库,iostat提供了观测方法。
$iostat
Linux 2.6.32 09/19/2018 _x86_64_ (24 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
2.60 0.17 2.79 0.99 0.00 93.44
Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
sdc 5.22 217.12 44.13 173388621 35239832
sdb 5.03 212.42 43.97 169638797 35110792
...
sda 34.62 11.24 425.25 8972630 339604008默认iostat输出包括了CPU使用,以及系统中每个磁盘信息:
tps- 每秒传输数(I/O请求)kB_read/s和kB_wrtn/s- 当前设备读取和写入每秒kBkB_read和kB_wrtn是系统启动之后读取和写入的数据量
上述默认输出的单位是kB,如果想显示成MB,则使用参数-m
$iostat -m
Linux 2.6.32 09/19/2018 _x86_64_ (24 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
2.60 0.17 2.79 0.99 0.00 93.44
Device: tps MB_read/s MB_wrtn/s MB_read MB_wrtn
sdc 5.22 0.21 0.04 171106 34580
sdb 5.01 0.21 0.04 166960 34470
...
sda 34.63 0.01 0.42 8766 334982参考
Last updated
Was this helpful?