Introduction of the command

The iostat command is used to collect statistics about system I/O status.

Syntax format

iostat [options]
Copy the code

Option to show

-C # displays CPU usage only -d # Displays device utilization only -k # Displays status in kilobytes per second, Instead of using blocks per second -m # Display status in megabytes per second -p # Display status of only block devices and all other partitions in use -t # display time when each report was generated -v # display format number and exit -x # display extended statusCopy the code

Application, for example,

View THE I/O status of a specified device

[root@centos7 ~]# iostat -x /dev/sda1 Linux 3.10.0-1127.18.2.el7.x86_64 (centos7) 03/28/202_x86_64_ (1 CPU) avg-CPU: %user % Nice % System % IOwait % Steal % IDLE 1.59 0.00 0.55 0.05 0.00 97.81 Device: RRQM /s WRQM /s r/s w/s rkB/s wkB/s AVgrq-sz AVgqu-sz await r_await w_await SVCTM %util sda1 0.00 0.00 0.04 0.00 0.15 0.05 0.00 0.00 1.07 0.73 63.50 1.02 0.00Copy the code

Result Field Description

RRQM /s # Number of read requests per second WRQM /s # Number of write requests per second R /s # Number of actual read requests per second W /s # Number of actual write requests per second rsec/s # Number of read segments per second wsec/s RkB /s # Actual read size per second, in KB wkB/s # Actual write size per second, Unit for KB avgrq - sz avgqu - sz # # needs the average size of section needs the average queue length await # wait for I/O the average time (milliseconds) SVCTM # I/O requirements to complete the average time is # % util I/O requirements consume CPU percentageCopy the code

Indicates the I/O status of the system

[root@centos7 ~]# iostat Linux 3.10.0-1127.18.2.el7.x86_64 (centos7) 03/28/202_x86_64_ (1 CPU) avg-CPU: %user % Nice % System % IOwait % Steal %idle 1.58 0.00 0.55 0.05 0.00 97.82 Device: TPS kB_read/s kB_wrtn/s kB_read kB_wrtn SDA 0.25 7.39 1.84 316339 78930 SDB 0.00 0.06 0.00 2592 0 SCd0 0.00 0.02 0.00 1028 0 dM-0 0.21 7.11 1.80 304267 dM-1 0.00 0.05 0.00 2204 0Copy the code

Other instances

[root@centos7 ~]# iostat -c Linux 3.10.0-1127.18.2.el7.x86_64 (centos7) 03/28/2021 _x86_64_ (1 CPU) avg-cpu: %user %nice %system % IOwait % Steal %idle 1.58 0.00 0.55 0.05 0.00 97.82 # root@centos7 ~]# iostat -d Linux 3.10.0-1127.18.2.el7.x86_64 (centos7) 03/28/2021 _x86_64_ (1 CPU) Device: TPS kB_read/s kB_wrtn/s kB_read kB_wrtn SDA 0.25 7.38 1.84 316339 78930 SDB 0.00 0.06 0.00 2592 0 SCd0 0.00 0.02 0.00 1028 0 dm-0 0.21 7.09 1.79 304267 76862 DM-1 0.00 0.05 0.00 2204 0 # display in kilobytes per second [root@centos7 ~]# iostat -k Linux 3.10.0-1127.18.2.el7.x86_64 (centos7) 03/28/202_x86_64_ (1 CPU) AVG-CPU: %user % Nice % System % IOwait % Steal %idle 1.58 0.00 0.55 0.05 0.00 97.82 Device: TPS kB_read/s kB_wrtn/s kB_read kB_wrtn SDA 0.25 7.37 1.84 316339 78930 SDB 0.00 0.06 0.00 2592 0 SCd0 0.00 0.02 0.00 1028 0 dm-0 0.21 7.09 1.79 304267 76862 DM-1 0.00 0.05 0.00 2204 0 # In megabytes per second [root@centos7 ~]# iostat -m Linux 3.10.0-1127.18.2.el7.x86_64 (centos7) 03/28/202_x86_64_ (1 CPU) AVG-CPU: %user % Nice % System % IOwait % Steal %idle 1.58 0.00 0.55 0.05 0.00 97.82 Device: TPS MB_read/s MB_wrtn/s MB_read MB_wrtn SDA 0.25 0.01 0.00 308 77 SDB 0.00 0.00 2 0 SCD0 0.00 0.00 1 0 DM-0 0.21 0.01 0.00 297 75 DM-1 0.00 0.00 2 0Copy the code

Learn a Linux command every day (106) : openssl

Learn a Linux command every day (107) : SAR

Learn a Linux command every day (108) : iptraf