Linux iostat command learning notes
1. Command Introduction
Iostat (I/O statistics input/output statistics) command to monitor system disk operation activities. It reports disk activity statistics and CPU usage.
2. Usage
Iostat [Option] [<time interval> [<times>]
3. Option-c: Only displays CPU usage;
-D: only display the device utilization. It is generally not used with-c.
-K: The display status is measured in kilobytes per second instead of blocks per second;
-M: The display status is measured in megabytes per second;
-N: Display disk array (LVM) Information
-N: displays NFS usage
-P: Only displays the status of the block device and all other partitions used;
-T: displays the time when each report is generated;
-V: displays the version number and exits;
-X: displays the scaling status.
4. Example 1: iostat command description
Detailed Description: the second line is system information and monitoring time,
Lines 3 and 4 show CPU usage
% User |
Percentage of time when the CPU is in user mode. |
% Nice |
Percentage of time when the CPU is in user mode with NICE value. |
% System |
Percentage of time when the CPU is in system mode. |
% Iowait |
Percentage of CPU waiting for input/output completion time. |
% Steal |
The percentage of idle waiting time of the virtual CPU when the hypervisor maintains another virtual processor. |
% Idle |
Percentage of idle CPU time. |
I/O output information
Device |
Block device name |
Tps |
The number of I/O transfers per second. Multiple I/O requests can be combined into one, and the number of bytes transmitted by each I/O request is different. Therefore, multiple I/O requests can be combined into one. |
Blk_read/s |
Number of read parts per second
|
Blk_wrtn/s |
Number of read parts per second
|
Blk_read |
Indicates the total number of data block reads since the system is started. |
Blk_wrtn |
Indicates the total number of data block writes since the system is started. |
Example 2: Use the-x parameter to obtain more statistics.
[Root @ Oracledb ~] # Iostat-x
Linux 2.6.32-573.8.1.el6.x86 _ 64 (oracledb) February _ x86_64 _ (4 CPU)
Avg-cpu: % user % nice % system % iowait % steal % idle
0.06 0.00 0.12 0.05 0.00 99.76
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm % util
Sda 2.62 0.84 2.91 0.38 202.32 9.75 64.61 0.00 1.44 0.76 0.25
Example 3: view the cpu status
[Root @ oracledb ~] # Iostat-c Linux 2.6.32-573.8.1.el6.x86 _ 64 (oracledb) August 29 _ x86_64 _ (4 CPU) avg-cpu: % user % nice % system % iowait % steal % idle 0.06 0.00 0.12 0.04 0.00
Example 4: view the disk read/write speed, in k
[Root @ oracledb ~] # Iostat-d-k Linux 2.6.32-573.8.1.el6.x86 _ 64 (oracledb) August 29 _ x86_64 _ (4 CPU) Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtnsda 3.20 98.34 4.77 933682 45257
Example 5: iostat-d 2 3 indicates that there is no 2-second check, and a total of 3 checks
[Root @ oracledb ~] # Iostat-d-k 2 3 Linux 2.6.32-573.8.1.el6.x86 _ 64 (oracledb) August _ x86_64 _ (4 CPU) Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtnsda 3.16 97.25 4.72 933682 45289 Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtnsda 0.00 0.00 0.00 0 0 Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtnsda 0.00 0.00 0.00 0 0
Example 6: view the status of a block device or partition
[Root @ oracledb ~] # Iostat-m-p/dev/sdaLinux 2.6.32-573.8.1.el6.x86 _ 64 (oracledb) February 28 _ x86_64 _ (4 CPU) avg-cpu: % user % nice % system % iowait % steal % idle 0.06 0.00 0.12 0.04 Device: tps MB_read/s MB_wrtn/s MB_read MB_wrtnsda 3.07 0.09 0.00 911 44sda1 0.07 0.00 0.00 2 0sda2 0.03 0.00 0.00 1 0sda3 2.95 0.09 0.00 44
RH442 strategy-iostat
Use the iostat command in Linux to generate a statistical report on CPU and I/O
Install iostat and mpstat
Brief description of Linux iostat command output
Linux iostat command
Linux iostat command instance details
Detailed description of iostat commands
This article permanently updates the link address: