1. Introduction to Commands
Iostat (I/O statistics input/output Statistics) command monitors the system's disk operation activity. It is characterized by the reporting of disk activity statistics, as well as the reporting of CPU usage
2. Usage
< time interval > < number of > ] ]
3. Options
-M: Display status in megabytes per second;
-N Display of disk array (LVM) information
-N Display of NFS usage
-X: Displays the extended state.
4. Example Example 1:iostat command description
The second line is the system information and the monitoring time,
The third and fourth lines show CPU usage
| %user |
The percentage of time that the CPU is in user mode. |
| %nice |
The percentage of time that the CPU is in user mode with the nice value. |
| %system |
The percentage of time that the CPU is in system mode. |
| %iowait |
The percentage of the CPU waiting for the input and output finish time. |
| %steal |
The percentage of the virtual CPU's unconscious wait time when the hypervisor maintains another virtualized processor. |
| %idle |
Percentage of CPU idle time. |
Information for I/O output
| Device |
The name of the block device |
| Tps |
The number of I/O transmissions per second for this device. Multiple I/O requests can be combined into one, and each I/O request transmits a different number of bytes, so multiple I/O requests can be combined into one. |
| blk_read/s |
每秒读取的块数
|
| blk_wrtn/s |
每秒读取的块数
|
| Blk_read |
Indicates the total number of chunks read since the system started |
| Blk_wrtn |
Indicates the total number of data block writes since the system started |
Example 2: Using the-x parameter, we can get more statistical information.
[Email protected] ~]# Iostat-Xlinux2.6. +-573.8.1. el6.x86_64 (OracleDB) April 30, 2016 _x86_64_ (4CPU) Avg-CPU:%user% Nice%system%iowait%steal%Idle0.06 0.00 0.12 0.05 0.00 99.76DEVICE:RRQM/s wrqm/s r/sW/s rsec/s wsec/s avgrq-sz Avgqu-sz await SVCTM%UTILSDA2.62 0.84 2.91 0.38 202.32 9.75 64.61 0.00 1.44 0.76 0.25
Example 3: View CPU Status
[Email protected] ~]# Iostat-2.6. -573.8. 1. el6.x86_64 (oracledb) April 30, 2016 _x86_64_ (4 CPU) Avg-cpu: %user % nice%system%iowait %steal %idle 0.06 0.00 0.12 0.04 0.00 99.77
Example 4: Check disk read and write speed, in K
[Email protected] ~]# iostat-d-2.6. -573.8. 1. el6.x86_64 (oracledb) April 30, 2016 _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 no 2 seconds are checked, and a total of 3 times
[[Email protected]~]# iostat-d-K2 3Linux2.6. +-573.8.1. el6.x86_64 (OracleDB) April 30, 2016 _x86_64_ (4CPU) Device:tps Kb_read/s kb_wrtn/s Kb_read kb_wrtnsda3.16 97.25 4.72 933682 45289Device:tps Kb_read/s kb_wrtn/s Kb_read kb_wrtnsda0.00 0.00 0.00 0 0Device:tps Kb_read/s kb_wrtn/s Kb_read kb_wrtnsda0.00 0.00 0.00 0 0
Example 6: View block device or partition status
[Email protected] ~]# iostat-m-p/dev/Sdalinux2.6. +-573.8.1. el6.x86_64 (OracleDB) April 30, 2016 _x86_64_ (4CPU) Avg-CPU:%user% Nice%system%iowait%steal%Idle0.06 0.00 0.12 0.04 0.00 99.77Device:tps Mb_read/s mb_wrtn/s Mb_read mb_wrtnsda3.07 0.09 0.00 911 -sda10.07 0.00 0.00 2 0sda20.03 0.00 0.00 1 0Sda32.95 0.09 0.00 907 -
One Linux command per day: Iostat