35+ stories, thoughts and ideas.35+ stories, thoughts and ideas.


stories, thoughts and ideas.

linux 使用iostat查看磁盘性能

iostat常用于观察磁盘的读写情况和监控性能。使用前需要安装sysstat。

sudo apt install sysstat

常用命令样例:

  • iostat --human 人类可读的输出
  • iostat -m 1 MB为单位,也可以换成-k KB为单位,后面数值1代表1秒钟刷新一次
  • iostat -x 5 输出更详细的信息,5秒钟刷新一次

注意观察,命令的第一次输出的数值是开机以来的统计数值,后续输出是刷新间隔的增量值。

$iostat  --human 1
Linux 5.15.0-41-generic (t620)     08/07/2022     _x86_64_    (4 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.5%    0.0%    0.2%    5.7%    0.0%   93.6%

Device             tps    MB_read/s    MB_wrtn/s    MB_dscd/s    MB_read    MB_wrtn    MB_dscd
sda               1.31        61.9k         0.0k         0.0k      27.7G       0.0k       0.0k

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.0%    0.0%   10.6%   15.2%    0.0%   74.2%

Device             tps    MB_read/s    MB_wrtn/s    MB_dscd/s    MB_read    MB_wrtn    MB_dscd
sda               0.00         0.0k         0.0k         0.0k       1.0k       0.0k       0.0k
本原创文章未经允许不得转载 | 当前页面:35+ stories, thoughts and ideas. » linux 使用iostat查看磁盘性能

评论