Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux iostat command example explanation     - Linux boot the system does not display a progress bar setting method (Linux)

- Use Redis as time-series database: why and how (Database)

- Use the Find command to help you find those files that need to be cleaned (Linux)

- Chromium Install Flash Official Guide (Linux)

- Linux firewall settings instance (Linux)

- Bash common several configuration files (Linux)

- Oracle EBS R12 for Linux installation (Database)

- Heartbeat cluster components Overview (Server)

- Oracle 10g relations with the constraint of column properties NULLABLE (Database)

- MongoDB in bulk timestamp change the date format (Database)

- Postmodern systems programming language (Programming)

- SUSE Linux network configuration and firewall configuration (Linux)

- CentOS 7 hard disk expansion toss record (Linux)

- Stunning exclamation point at the Linux command line (Linux)

- Linux file system structure Introduction (Linux)

- Oracle table space create large files (Database)

- Laravel 4.2 Laravel5 comprehensive upgrade Raiders (Server)

- Migu online music player for Linux (Linux)

- MySQL database under Linux to achieve automatic backup scheduled backup day (Database)

- About Java 7 module system (Programming)

 
         
  Linux iostat command example explanation
     
  Add Date : 2017-05-29      
         
         
         
  1 Introduction Command

Linux system iostat is the I / O statistics (input / output statistics) acronym, iostat disk operating system will be the active tool is monitored. It features disk activity statistics reporting the situation, while also reporting the CPU usage. Like with vmstat, iostat also has a weakness, it is not a process for the overall situation in-depth analysis, the system only for analysis. iostat belong sysstat package. Can be directly installed with yum install sysstat.

1.1 Command Format:

iostat [parameters] [time] [number]

1.2 command:

By iostat easy viewing CPU, network card, tty devices, disk, CD-ROM, and so on device activity, load information.

1.3 Command parameters:

-c Show CPU usage

-d Displays disk usage

-k in KB display

-m display unit to M

-N Display array (LVM) information

-n Display NFS usage

-p [disk] display cases of disks and partitions

-t display terminal and CPU information

-x Show Details

-V Display version information

Example 2:

2.1 Example 1: Show all devices load

Command: iostat

Output:

[Root @ CT1186 ~] # iostat

Linux 2.6.18-128.el5 (CT1186) 2013 Nian 08 Yue 23 Ri

avg-cpu:% user% nice% system% iowait% steal% idle

8.30 0.02 5.07 0.17 0.00 86.44

Device: tps Blk_read / s Blk_wrtn / s Blk_read Blk_wrtn

Sda 22.73 43.70 487.42 674035705 7517941952

sda1 0.00 0.00 0.00 2658 536

sda2 0.11 3.74 3.51 57721595 54202216

sda3 0.98 0.61 17.51 9454172 270023368

sda4 0.00 0.00 0.00 6 0

sda5 6.95 0.12 108.73 1924834 1677123536

sda6 2.20 0.18 31.22 2837260 481488056

sda7 12.48 39.04 326.45 602094508 5035104240

Explanation:

cpu Property Value Description:

% User: CPU percentage of time in user mode.

% Nice: CPU in user mode with the percentage of time under the NICE value.

% System: CPU in the percentage of time the system mode.

% Iowait: CPU waiting for input and output completion percentage.

% Steal: the management of the program by maintaining a second virtual processor, a virtual CPU waits for the percentage of time unconscious.

% Idle: CPU idle time percentage.

Note: If the value of% iowait too high, indicating the presence of the hard disk I / O bottlenecks,% idle value is high, said more CPU is idle, if the% idle value is high but the system response slow, it may be waiting for allocation of CPU memory, and you should increase the memory capacity. % Idle Sustained value if less than 10, then the CPU processing capacity of the system is relatively low, indicating that the system resources are most needed to solve the CPU.

disk properties Value Description:

rrqm / s: The number of read operations performed per second merge. That rmerge / s

Write the number of operations per second merge: wrqm / s. That wmerge / s

r / s: completed per second read I / O device number. That rio / s

w / s: per second complete write I / O device number. That wio / s

rsec / s: second reading sectors. That rsect / s

wsec / s: write the number of sectors per second. That wsect / s

rkB / s: the number of bytes read per second K. It is rsect / s half, as each sector size of 512 bytes.

wkB / s: write the number of bytes per second K. It is wsect / s in half.

avgrq-sz: the average size of each data device I / O operations (sector).

avgqu-sz: average I / O queue length.

Await: average each device I / O operations waiting time (in milliseconds).

Svctm: The average service time of each device I / O operations (in milliseconds).

% Util: one second what percentage of the time for I / O operations, cpu consumption percentage namely io

NOTE: If% util close to 100%, indicating that generates an I / O request is too much, I / O system has been at full capacity, the disk may be a bottleneck. If svctm close to await, illustrate I / O almost no wait time; if await is much greater than svctm, Description I / O queue is too long, io response is too slow, you need to make the necessary optimization. If avgqu-sz is relatively large, also expressed equivalent io waiting.

2.2 Example 2: Timing display all the information

Command: iostat 2 3

Output:

[Root @ CT1186 ~] # iostat2 3

Linux 2.6.18-128.el5 (CT1186) 2013 Nian 08 Yue 23 Ri

avg-cpu:% user% nice% system% iowait% steal% idle

8.30 0.02 5.07 0.17 0.00 86.44

Device: tps Blk_read / s Blk_wrtn / s Blk_read Blk_wrtn

Sda 22.73 43.70 487.42 674035705 7517947296

sda1 0.00 0.00 0.00 2658 536

sda2 0.11 3.74 3.51 57721595 54202216

sda3 0.98 0.61 17.51 9454172 270023608

sda4 0.00 0.00 0.00 6 0

sda5 6.95 0.12 108.73 1924834 1677125640

sda6 2.20 0.18 31.22 2837260 481488152

sda7 12.48 39.04 326.44 602094508 5035107144

 

avg-cpu:% user% nice% system% iowait% steal% idle

8.88 0.00 7.94 0.19 0.00 83.00

Device: tps Blk_read / s Blk_wrtn / s Blk_read Blk_wrtn

Sda 6.00 0.00 124.00 0 248

sda1 0.00 0.00 0.00 0 0

sda2 0.00 0.00 0.00 0 0

sda3 0.00 0.00 0.00 0 0

sda4 0.00 0.00 0.00 0 0

sda5 0.00 0.00 0.00 0 0

sda6 0.00 0.00 0.00 0 0

sda7 6.00 0.00 124.00 0 248

 

avg-cpu:% user% nice% system% iowait% steal% idle

9.12 0.00 7.81 0.00 0.00 83.07

Device: tps Blk_read / s Blk_wrtn / s Blk_read Blk_wrtn

Sda 4.00 0.00 84.00 0 168

sda1 0.00 0.00 0.00 0 0

sda2 0.00 0.00 0.00 0 0

sda3 0.00 0.00 0.00 0 0

sda4 0.00 0.00 0.00 0 0

sda5 0.00 0.00 0.00 0 0

sda6 4.00 0.00 84.00 0 168

sda7 0.00 0.00 0.00 0 0

Explanation:

Every 2 seconds to refresh the display, and the display 3 times

2.3 Example 3: Displays disk information

Command: iostat -d sda1

Output:

[Root @ CT1186 ~] # iostat-d sda1

Linux 2.6.18-128.el5 (CT1186) 2013 Nian 08 Yue 23 Ri

Device: tps Blk_read / s Blk_wrtn / s Blk_read Blk_wrtn

sda1 0.00 0.00 0.00 2658 536

Explanation:

2.4 Example 4: Displays information tty and Cpu

Command: iostat -t

Output:

[Root @ CT1186 ~] # iostat-t

Linux 2.6.18-128.el5 (CT1186) 2013 Nian 08 Yue 23 Ri

Time: 14 Shi Fen 58 35 Miao

avg-cpu:% user% nice% system% iowait% steal% idle

8.30 0.02 5.07 0.17 0.00 86.44

Device: tps Blk_read / s Blk_wrtn / s Blk_read Blk_wrtn

Sda 22.73 43.70 487.41 674035705 7517957864

sda1 0.00 0.00 0.00 2658 536

sda2 0.11 3.74 3.51 57721595 54202216

sda3 0.98 0.61 17.51 9454172 270024344

sda4 0.00 0.00 0.00 6 0

sda5 6.95 0.12 108.73 1924834 1677128808

sda6 2.20 0.18 31.22 2837260 481488712

sda7 12.48 39.04 326.44 602094508 5035113248

Explanation:

2.5 Example 5: Displays all the information units of M

Command: iostat -m

Output:

[Root @ CT1186 ~] # iostat-m

Linux 2.6.18-128.el5 (CT1186) 2013 Nian 08 Yue 23 Ri

avg-cpu:% user% nice% system% iowait% steal% idle

8.30 0.02 5.07 0.17 0.00 86.44

Device: tps MB_read / s MB_wrtn / s MB_read MB_wrtn

Sda 22.72 0.02 0.24 329119 3670881

sda1 0.00 0.00 0.00 1 0

sda2 0.11 0.00 0.00 28184 26465

sda3 0.98 0.00 0.01 4616 131848

sda4 0.00 0.00 0.00 0 0

sda5 6.95 0.00 0.05 939 818911

sda6 2.20 0.00 0.02 1385 235102

sda7 12.48 0.02 0.16 293991 2458553

Explanation:

2.6 Example 6: View TPS and throughput information

Command: iostat -d -k 1 1

Output:

[Root @ CT1186 ~] # iostat-d -k 1 1

Linux 2.6.18-128.el5 (CT1186) 2013 Nian 08 Yue 23 Ri

Device: tps kB_read / s kB_wrtn / s kB_read kB_wrtn

Sda 22.72 21.85 243.71 337017916 3758984340

sda1 0.00 0.00 0.00 1329 268

sda2 0.11 1.87 1.76 28860797 27101108

sda3 0.98 0.31 8.75 4727086 135012508

sda4 0.00 0.00 0.00 3 0

sda5 6.95 0.06 54.37 962481 838566148

sda6 2.20 0.09 15.61 1418630 240744712

sda7 12.48 19.52 163.22 301047254 2517559596

Explanation:

tps: The number of transfers per second device (Indicatethe number of transfers per second that were issued to the device.). "A transfer" means "once I / O requests." Multiple logical requests can be combined into "one I / O request." "A transfer" requested size is unknown.

kB_read / s: amount of data read from the device (drive expressed) per second;

kB_wrtn / s: the amount of data per second to the device (driveexpressed) written;

kB_read: The total amount of data read; kB_wrtn: the amount of the total number of data writing;

These units are Kilobytes.

The above example, we can see the disk sda and its statistical data each partition, when the total disk statistics TPS is 22.73, below are each partition TPS. (Because it is an instantaneous value, so the total TPS is not strictly equal to the sum of each partition TPS)

2.7 Example 7: View the status of cpu

Command: iostat -c 1 3

Output:

[Root @ CT1186 ~] # iostat -c 1 3

Linux 2.6.18-128.el5 (CT1186) 2013 Nian 08 Yue 23 Ri

avg-cpu:% user% nice% system% iowait% steal% idle

8.30 0.02 5.07 0.17 0.00 86.44

avg-cpu:% user% nice% system% iowait% steal% idle

8.64 0.00 5.38 0.00 0.00 85.98

avg-cpu:% user% nice% system% iowait% steal% idle

7.62 0.00 5.12 0.50 0.00 86.75

2.8 Example 8: View device usage (% util), response time (await)

Command: iostat -d -x -k 1 1

Output:

[Root @ CT1186 ~] # iostat-d -x -k 1 1

Linux 2.6.18-128.el5 (CT1186) 2013 Nian 08 Yue 23 Ri

Device: rrqm / s wrqm / s r / s w / s rkB / s wkB / s avgrq-sz avgqu-sz await svctm% util

Sda 0.44 38.59 0.40 22.32 21.85 243.71 23.37 0.04 1.78 4.20 9.54

sda1 0.00 0.00 0.00 0.00 0.00 0.00 18.90 0.00 8.26 6.46 0.00

sda2 0.36 0.43 0.11 0.01 1.87 1.76 63.57 0.01 63.75 1.94 0.02

sda3 0.00 1.24 0.04 0.95 0.31 8.75 18.42 0.04 39.77 8.73 0.86

sda4 0.00 0.00 0.00 0.00 0.00 0.00 2.00 0.00 19.67 19.67 0.00

sda5 0.00 6.65 0.00 6.94 0.06 54.37 15.67 0.26 36.81 4.48 3.11

sda6 0.00 1.71 0.01 2.19 0.09 15.61 14.29 0.03 12.40 5.84 1.28

sda7 0.08 28.56 0.25 12.24 19.52 163.22 29.28 0.27 21.46 5.00 6.25

Explanation:

rrqm / s: The number of read operations performed per second merge. That delta (rmerge) / s

Write the number of operations per second merge: wrqm / s. That delta (wmerge) / s

r / s: completed per second read I / O device number. That delta (rio) / s

w / s: per second complete write I / O device number. That delta (wio) / s

rsec / s: second reading sectors. That delta (rsect) / s

wsec / s: write the number of sectors per second. That delta (wsect) / s

rkB / s: the number of bytes read per second K. It is rsect / s half, as each sector size of 512 bytes.

wkB / s:. Write the number of bytes per second K is half wsect / s of.

avgrq-sz: the average size of each data device I / O operations (sector). delta (rsect + wsect) / delta (rio + wio)

avgqu-sz: average I / O queue length. That delta (aveq) / s / 1000 (because aveq of milliseconds).

await: the average waiting time each device I / O operations (in milliseconds). That delta (ruse + wuse) / delta (rio + wio)

svctm: The average service time of each device I / O operations (in milliseconds). That delta (use) / delta (rio + wio)

% Util: one second what percentage of the time for I / O operations, or how much time is one second I / O queue is not empty, that delta (use) / s / 1000 (because the use of the unit ms)

If% util close to 100%, indicating that generates an I / O request is too much, I / O system has been at full capacity, the disk may be a bottleneck. idle less than 70% IO pressure on the larger, more general reading speed wait.

At the same time it can be combined with vmstat View View b parameters (number of processes waiting for resources) and wa parameters (percentage of occupied CPU IO wait time, 30% higher than when the pressure is high IO).

Additional parameters must await more and svctm to reference. The difference is too high there must IO problems.

avgqu-sz is also doing IO tuning needed attention, this is the size of the data directly to each operation, if more often, but the data take small, in fact, IO will be small. If the data take, then the IO data will be high. Can also avgqu-sz x (r / s or w / s) = rsec / s or wsec / s. That is, speaking, reading speed is set to decide this.

svctm generally less than await (because the waiting time while waiting for a request to be double counting), svctm general size and related disk performance, CPU / memory load will affect them, too many requests will indirectly lead to the svctm increase. await size generally depends on the service time (svctm) and I / O queue length and I / O requests issued mode. If svctm close to await, illustrate I / O almost no wait time; if await is much greater than svctm, described the response time of I / O queue is too long, the application was slow, if the response time exceeds the permissible range of users, then you can consider replacing faster disk, adjust elevator core algorithm, optimization applications, or upgrade CPU.

Queue length (avgqu-sz) can also be used as a measure of system I / O load indicators, but because avgqu-sz is in accordance with the average value per unit of time, it can not reflect the instant I / O flood.

Vivid metaphor:

r / s + w / s similar to the payment of the total number of people

The average queue length (avgqu-sz) is similar to the average number of units of time queuing people

Receivables speed average service time (svctm) similar to the cashier

The average waiting time (await) similar to the average waiting time per person

The average I / O data (avgrq-sz) is similar to the average person to buy something much

The proportion of time I / O operation rate (% util) stage was similar receivables queuing

Device IO operations: Total IO (io) / s = r / s (read) + w / s (write) = 1.46 + 25.28 = 26.74

The average per-device I / O operation requires only 0.36 milliseconds, 10.57 milliseconds it takes now, because too many requests made per second (26.74), while the issue of when, if requested, can be calculated as the average waiting time:

Average waiting time = single I / O server time * (1 + 2 + ... + total number of requests -1) / total number of requests

I / 0 requests issued per second lot, but on the average queue 4, expressed these requests more evenly, most of the processing is quite timely.

3 for the analysis of the data given by the user

Iostat output provided by the user:

avg-cpu:% user% nice% system% iowait% steal% idle

0.03 0.00 0.03 6.74 0.00 93.19

Device: rrqm / s wrqm / s r / s w / s rMB / s wMB / s avgrq-sz avgqu-sz awaitsvctm% util

sda 0.00 198.00 0.50 135.00 0.00 1.27 19.25 1.16 8.58 7.34 99.45

sda1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

sda2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

sda3 0.00 198.00 0.50 135.00 0.00 1.27 19.25 1.16 8.58 7.34 99.45

had 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

Parameter Description:

rrqm / s: The number of read operations performed per second merge. That delta (rmerge) / s

Write the number of operations per second merge: wrqm / s. That delta (wmerge) / s

r / s: completed per second read I / O device number. That delta (rio) / s

w / s: per second complete write I / O device number. That delta (wio) / s

rkB / s: the number of bytes read per second K. It is rsect / s half, as each sector size of 512 bytes.

wkB / s: write the number of bytes per second K. It is wsect / s in half.

avgrq-sz: the average size of each data device I / O operations (sector). delta (rsect + wsect) / delta (rio + wio)

avgqu-sz: average I / O queue length. That delta (aveq) / s / 1000 (because aveq of milliseconds).

await: the average waiting time each device I / O operations (in milliseconds). That delta (ruse + wuse) / delta (rio + wio)

svctm: The average service time of each device I / O operations (in milliseconds). That delta (use) / delta (rio + wio)

% Util: one second what percentage of the time for I / O operations, or how much time is one second I / O queue is not empty, that delta (use) / s / 1000 (because the use of the unit ms)

analysis:

Currently 99.45% util value is already close to 100%, indicating that I created / O request is too much, I / O systems may have been at full capacity, the disk may be a bottleneck.

Meanwhile await reference value (8.58) and svctm value (7.34) is close, indicating that I / O is almost no wait time. svctm generally less than await (because the waiting time while waiting for a request to be double counting), svctm general size and related disk performance, CPU / memory load will affect them, too many requests will indirectly lead to the svctm increase. await size generally depends on the service time (svctm) and I / O queue length and I / O requests issued mode.

avgqu-sz value is 1.16; the size of the data directly to each operation, if more often, but the data take small, in fact, IO will be small. If the data take, then the IO data will be high. Queue length (avgqu-sz) can also be used as a measure of system I / O load indicators, but because avgqu-sz is in accordance with the average value per unit of time, it can not reflect the instant I / O flood.

resolution:

On the whole disk write I / O requests are too frequent, it is recommended to consider the write optimization algorithm. Or upgrade disk I / O.
     
         
         
         
  More:      
 
- Java heap (Heap) and stack difference (Programming)
- Common Linux System Troubleshooting (Linux)
- Redis-- persistence articles (Database)
- Compile and install Ubuntu Linux 4.0.5 kernel, network and fix vmware kernel module compilation error (Linux)
- SSH Filesystem use a secure connection for network file system (Linux)
- Linux terminal program running in the background (Linux)
- Linux NIC configuration (Linux)
- Efficient Linux Shell - Shell special characters Summary (Linux)
- Nginx introduced Dynamic Module Architecture (Server)
- CentOS 6.5 / Linux restart network card being given Determining if ip address x.x.x.x is already in use (Linux)
- Ubuntu and derivative system users how to install Pinta 1.5 (Linux)
- Ubuntu Backup and Recovery (Linux)
- To setup CentOS LAMP environment (Server)
- Linux common network tools: Scan routing of mtr (Linux)
- JavaScript is implemented without new keywords constructor (Programming)
- File compression and packaging commands under Linux (Linux)
- After installing minimize RHEL / CentOS 7 need to do some things (Linux)
- PHP Performance Analysis and Experiment: Performance Micro Analysis (Programming)
- Android using SVG vector graphics to create cool animation effects (Programming)
- Thinking in Java study notes - initialization and cleanup (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.