70. Process Management - iostat
Contents
A tool called iostat can be used to display CPU reports, it can also be used to display disk, partition input and output statistics reports.
CPU Utilization Report
Here are some columns of CPU report:
Column | Description |
---|---|
%user | User level CPU usage. (application CPU usage) |
%nice | CPU usage with nice priority at the user level. |
%system | System level CPU usage. (kernel CPU usage) |
%iowait | The time CPU or CPUs were idle when the system had an unfinished disk I/O operation. |
%steal | The amount of time the current processor unwillingly waits when the hypervisor is serving other virtual processors. |
%idle | The time CPU or CPUs were idle when the system had no unfinished disk I/O operations. |
Device Utilization Report
Here are some columns of device report:
Column | Description |
---|---|
Device | The device (partition) name listed under the /dev directory. |
tps | Transfers per second sent to the device. Each transfer is an I/O request, which is usually a combination of multiple logical requests. |
Blk_read/s (kB_read/s, MB_read/s) | The number of blocks read from the device per second. |
Blk_wrtn/s (kB_wrtn/s, MB_wrtn/s) | The number of blocks written to the device per second. |
Blk_dscd/s (kB_dscd/s, MB_dscd/s) | The number of blocks discarded for the device per second. |
Blk_read (kB_read, MB_read) | The total number of blocks read from the device. |
Blk_wrtn (kB_wrtn, MB_wrtn) | The total number of blocks written to the device. |
Blk_dscd (kB_dscd, MB_dscd) | The total number of blocks discarded for the device. |
r/s | Read requests per second completed for the device. |
w/s | Write requests per second completed for the device. |
d/s | Discard requests per second completed for the device. |
sec/s (kB/s, MB/s) | The number of sectors read from, written to, or discarded for the device per second. |
rsec/s (rkB/s, rMB/s) | The number of sectors read from the device per second. |
wsec/s (wkB/s, wMB/s) | The number of sectors written to the device per second. |
dsec/s (dkB/s, dMB/s) | The number of sectors discarded for the device per second. |
rqm/s | The number of merged I/O requests per second in the device queue. |
rrqm/s | The number of merged read requests per second in the device queue. |
wrqm/s | The number of merged write requests per second in the device queue. |
drqm/s | The number of merged discarded requests per second in the device queue. |
%rrqm | The percentage of merged read requests per second before being sent to the device. |
%wrqm | The percentage of merged write requests per second before being sent to the device. |
%drqm | The percentage of merged discard requests per second before being sent to the device. |
areq-sz | The average size of the I/O requests sent to the device. |
rareq-sz | The average size of the I/O read requests sent to the device. |
wareq-sz | The average size of the I/O write requests sent to the device. |
dareq-sz | The average size of the I/O discard requests sent to the device. |
await | Average time spent on I/O requests sent to the device, including queuing and service time. |
r_await | Average time spent on read requests sent to the device, including queuing and service time. |
w_await | Average time spent on write requests sent to the device, including queuing and service time. |
d_await | Average time spent on discard requests sent to the device, including queuing and service time. |
aqu-sz | The average queue length sent to the device. |
%util | The percentage of time run-time I/O requests sent to the device. |
Options
Here are some sorting commands for glances:
Option | Description |
---|---|
-c | Show CPU Report |
-d | Show Device Report |
-g group_name {device […]|ALL} | Show Statistics for a Group of Devices |
-h | Show Device Report as Human Readable Format |
-k | Show Units in Kilobytes |
-m | Show Units in Megabytes |
-p [{device[,…]|ALL}] | Show Block Devices and Their Partitions |
-t | Show the Time for Each Report |
-x | Show Extended Information |
Examples
We need to install it first:
|
|
Run iostat
|
|
Show CPU Report
|
|
Show Device Report
|
|
Show Statistics for a Group of Devices
|
|
Show Device Report as Human Readable Format
|
|
Show Units in Kilobytes
|
|
Show Units in Megabytes
|
|
Show Block Devices and Their Partitions
|
|
Show the Time for Each Report
|
|
Show Extended Information
|
|
References IOSTAT(1)
Author Dong Chen
LastMod Thu Apr 11 2019