Linux Performance monitoring Tool Iostat detailed

Source: Internet
Author: User
Tags disk usage

as an OPS engineer, it is necessary to master some of the system's analytical tools . .

Command tool: Iostat

So what can it do? You can see it through the man page.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6B/82/wKioL1UvfsKgbz1aAADSA6zbhYA838.jpg "title=" 1.png " alt= "Wkiol1uvfskgbz1aaadsa6zbhya838.jpg"/>

"One": Statistics the status of the CPU

"Two": Statistical device or Partition I/O information

The following is a simple explanation of common parameters

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6B/82/wKioL1UvfuLTUwYxAAM9W4b14l8085.jpg "title=" 2.png " alt= "Wkiol1uvfultuwyxaam9w4b14l8085.jpg"/>

-C: Displays CPU statistics and cannot be used in conjunction with-D

-D: Output device and partition I/O information cannot be used in conjunction with-C

-H: Display more readable NFS directory statistics

-K: Use "kbytes/s" instead of "block/S" to display statistics. Request kernel>=2.4

-M: Use "mbytes/s" instead of "block/S" to display statistics. Request kernel>=2.4

-T: Displays NFS directory statistics. Kernel>=2.6.17 && cannot be used in conjunction with-X

-X: Displays extended statistics. cannot be used in conjunction with-P and-N, kernel>=2.5 because it requires/proc/diskstats or loading SYSFS to get statistics

-P: Displays the block devices used by the system and their partition statistics. cannot be used in conjunction with-X, if a device name is specified, statistics for the specified device and all its partitions are displayed, and if the keyword all is used, all block device and partition statistics for the system are displayed.

Count: Number of refreshes

Interval: time interval for refresh

OK for examples

Count CPU usage, output three times and refresh every second

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6B/82/wKioL1UvfxHQJfWOAADijwMfmKk581.jpg "title=" 3.png " alt= "Wkiol1uvfxhqjfwoaadijwmfmkk581.jpg"/>

%system: Percentage of CPU that the system process consumes

%iowait: Percentage of idle CPU time when the system outputs data to disk, also called iowait wait

%idle: The system does not have any data output to the disk CPU time percentage, that is, the current CPU idle rate.

There is a good enough CPU for my server to be visible

Statistics disk usage, output three times and refresh every two seconds

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6B/86/wKiom1Uvfe3gzPK4AAFMb7VEQN4138.jpg "title=" 4.png " alt= "Wkiom1uvfe3gzpk4aafmb7veqn4138.jpg"/>

Device: That is, the unit name

TPS: The number of times a device transmits per second, an I/O request represents a transmission. Multiple logical requests may be merged into "one I/O request", and the size of the "one transfer" request is unknown.

BLK_READ/S: The amount of data read from the device per second

BLK_WRITN/S: The amount of data written to the device per second

Blk_read: Total amount of data read

BLK_WRTN: Total amount of data written

The most commonly used analysis

I Ostat – D – K 1

I Ostat – D – M 3

I Ostat – D – x – K 1

The example analysis is as follows:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6B/86/wKiom1UvfiywLNe2AAKhQbzo7CY142.jpg "title=" 5.png " alt= "Wkiom1uvfiywlne2aakhqbzo7cy142.jpg"/>

In the above, I only analyze xvdd this device (DEV)

As you can see, the average number of disks per 3 seconds is about 10.5, and every 3 seconds disk reads about 62KB, writes about: 110KB, this value is not an accurate value, why? Know why? Because of the time period problem

The best test is to find the average number of times or use the method to find the current value

As shown below:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6B/86/wKiom1Uvfk2jn_KzAAC-70HOJzU414.jpg "title=" 6.png " alt= "Wkiom1uvfk2jn_kzaac-70hojzu414.jpg"/>

There are many more detailed extensions for Iostat, with the-X option to get detailed

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6B/86/wKiom1UvfuHiIC7XAAFHAhXTLuE741.jpg "title=" 8.png " alt= "Wkiom1uvfuhiic7xaafhahxtlue741.jpg"/>

This is very detailed, such as the number of read/write sectors per second, I/O queue length, I/O operation time, etc.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6B/82/wKioL1Uvf8OjyKCPAAO0LVKcMO0842.jpg "title=" 7.png " alt= "Wkiol1uvf8ojykcpaao0lvkcmo0842.jpg"/>

For the use of other parameters of Iostat please man or Google

##########################################################################################

PostScript

Why is the iostat output like this? So how does the Iostat command really work for Linux performance testing? Actually these I also do not understand, at this time you need to know how iostat is designed, see source code

The main concern is about 4 are related to kernel

Diskstats,partitions,stat,cpuinfo under the/proc/directory

Omitted here, need to ask Google or wget


This article is from the "Hello_world" blog, make sure to keep this source http://coward.blog.51cto.com/7599475/1633520

Linux Performance monitoring Tool Iostat detailed

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.