Linux iostat

Source: Internet
Author: User
Tags disk usage

In Linux, performance problems occur. Generally, we can use top, iostat, free, vmstat, and other commands to locate the problem. Iostat can provide us with a wealth of IO status data.

1. Basic use

$ Iostat-d-k 1 10

The-d parameter indicates that the usage status of the device (disk) is displayed.-k indicates that Kilobytes is used as the unit of block usage. 1 10 indicates that the data is refreshed every one second, 10 times in total.

 

 


Tps: the number of transmissions per second (Indicate the number of transfers per second that were issued to the device .). "One transmission" means "one I/O request ". Multiple logical requests may be merged into one I/O request ". The size of a "one-time transmission" request is unknown.

KB_read/s: the amount of data read from the device (drive expressed) per second; kB_wrtn/s: the amount of data written to the device (drive expressed) per second; kB_read: the total amount of data read; kB_wrtn: the total amount of data written. These units are Kilobytes.

In the above example, we can see the statistics of the disk sda and its various partitions. At that time, the total TPS of the disk is 39.29. Below is the TPS of each partition. (Because it is an instantaneous value, the total TPS is not exactly equal to the Total TPS of each partition)

2.-x parameters

Use the-x parameter to obtain more statistics.

 


Rrqm/s: the number of read requests related to this device per second is Merge (when the system calls a request to read data, VFS sends the request to each FS, if FS finds that different read requests read data of the same Block, FS merges the request with Merge); wrqm/s: the number of write requests related to this device per second is Merge.

Rsec/s: Number of read sectors per second; wsec/: number of write sectors per second. R/s: The number of read requests that were issued to the device per second; w/s: The number of write requests that were issued to the device per second;

Await: Average time (unit:MicrosecondsMilliseconds ). It can be understood as the IO response time. Generally, the system IO response time should be less than 5 ms. If it is greater than 10 ms, it will be relatively large.

% Util: all IO processing time within the statistical time, divided by the total statistical time. For example, if the statistical interval is 1 second, the device processes IO for 0.8 seconds, and the device is idle for 0.2 seconds, % util = 0.8/1 = 80%, therefore, this parameter implies the degree to which the device is busy. Generally, if this parameter is set to 100%, it indicates that the device is nearing full load (of course, if it is a multi-disk, even if % util is 100%, because of the disk concurrency, so the disk usage may not be a bottleneck ).

3.-c parameters

Iostat can also be used to obtain the status values of some CPUs:

 

4. Common usage

 

 


5. Instance analysis

 

 


As shown above, the average number of disk transfers per second is about 400; the disk reads about 5 MB per second, and writes about 1 MB.

 

 

The average response time of the disk is <5 ms, and the disk usage is> 80. The disk response is normal, but it is busy.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.