Note: Kylin V10 SP1 (GNU/Linux 5.4.18-35-generic x86_64) 默认未集成此命令。
另请参阅: pidstat
每隔 1 秒统计一次,总计 2 次输出硬盘统计信息:
root@:~# iostat -d -x 1 2 Linux 4.4.0-203-generic (iZj6DERGFpwhhkdertjxh0Z) 12/01/2022 _x86_64_ (1 CPU) Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util vda 0.02 1.84 26.21 1.72 768.88 18.84 56.39 0.06 2.17 2.21 1.60 0.40 1.11 Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util vda 0.00 0.00 1.02 0.00 8.16 0.00 16.00 0.00 4.00 4.00 0.00 4.00 0.41 root:~#
%util 按时间百分比的利用率 (超 80% 意味着磁盘存在性能瓶颈)
root@:~# iostat -h
Linux 4.4.0-203-generic (iZj6cetgdpwhhtghyrjxh0Z) 12/01/2022 _x86_64_ (1 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
1.68 0.00 1.23 1.00 0.00 96.10
Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
vda
27.97 769.80 18.86 192312649 4711116
root:~#
基本语法
iostat [ options ] [ <interval> [ <count> ] ]
options 选项
[ -c ] [ -d ] [ -h ] [ -k | -m ] [ -N ] [ -t ] [ -V ] [ -x ] [ -y ] [ -z ]
[ -j { ID | LABEL | PATH | UUID | ... } ]
[ [ -H ] -g <group_name> ] [ -p [ <device> [,...] | ALL ] ]
[ <device> [...] | ALL ]
选项
| 参数 | EN 解释 | 中文翻译 | Remark |
|---|---|---|---|
| Function | 命令 | Explanation | Remark |
|---|---|---|---|
| Version | iostat -V | 展示版本信息 | |
| iostat -Version | |||
| 帮助 | iostat --help | 展示帮助信息 |
Copyright Notice: This article is an exclusive original manuscript, copyright belongs to Happy Digits Software , shall not be reproduced without permission.