A preliminary analysis of Linux Iostat performance

Source: Internet
Author: User


The Iostat in a Linux system is an abbreviation for I/O statistics (input/output statistics), and the Iostat tool monitors the system's disk operation activity.
It is characterized by reporting disk activity statistics, as well as reporting CPU usage. Like Vmstat, Iostat also has a weakness, that is, it cannot analyze a process in depth, only the overall situation of the system. Iostat belongs to the Sysstat package. Can be installed directly with Yum install Sysstat.

command format:
iostat[parameters [TIME] [number]

Command parameters:

    • -C Display of CPU usage

    • -D Display disk usage

    • -K displays in kilobytes

    • -m displays in units of M.

    • -N Display of disk array (LVM) information

    • -N Display of NFS usage

    • -p[disk] Displays disk and partition conditions

    • -t display terminal and CPU information

    • -X to display detailed information

    • -V Display version information


iostat Command

is displayed every 10 seconds, always.

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/8B/25/wKioL1hGCGeAtuq7AABtcKUtgTE275.png-wh_500x0-wm_3 -wmp_4-s_2421298163.png "title=" 111.png "alt=" Wkiol1hgcgeatuq7aabtckutgte275.png-wh_50 "/>


CPU attribute value

    • %user:cpu the percentage of time in user mode.

    • %nice:cpu the percentage of time in user mode with nice value.

    • %system:cpu the percentage of time in system mode.

    • %iowait:cpu the percentage of time to wait for the input output to finish.

    • %steal: The percentage of the virtual CPU's unconscious wait time when the hypervisor maintains another virtualized processor.

    • %IDLE:CPU idle time percentage.

Note:

    • If the value of%iowait is too high, it indicates that the hard disk has an I/O bottleneck

    • The%idle value is high, indicating that the CPU is more idle,

    • If the%idle value is high but the system responds slowly, it is possible that the CPU waits for the allocated memory, and the memory capacity should be increased at this time.

    • If the%idle value continues below 10, the system's CPU processing power is relatively low, indicating that the most resource to be addressed in the system is the CPU.

Each column of the disk has the following meanings:

  • RRQM/S: The number of read operations per second for the merge. namely RMERGE/S

  • WRQM/S: The number of write operations per second for the merge. namely WMERGE/S

  • R/S: Number of Read I/O devices completed per second. namely RIO/S

  • W/S: Number of write I/O devices completed per second. namely WIO/S

  • RSEC/S: Number of Read sectors per second. namely RSECT/S

  • WSEC/S: Number of Write sectors per second. namely WSECT/S

  • rkb/s: Reads K bytes per second. is half the rsect/s because the sector size is 512 bytes

  • wkb/s: Writes K bytes per second. It's half the wsect/s.

  • Avgrq-sz: Average data size Per device I/O operation (Sector)

  • Avgqu-sz: Average I/O queue length.

  • Await: Average wait time per device I/O operation (MS)

  • SVCTM: Average service time Per device I/O operation (MS)

  • %util: How much time in a second is spent on I/O operations, or how many times in a second I/O queues are non-empty.


Note:

    • If%util is close to 100%, it indicates that there are too many I/O requests, the I/O system is full, and the disk may have bottlenecks.

    • If SVCTM is closer to await, I/O has almost no waiting time;

    • If the await is much larger than SVCTM, stating that the I/O queue is too long and the IO response is too slow, the necessary optimizations need to be made.

    • If the Avgqu-sz is larger, it also indicates that there is an equivalent IO waiting.

How do you understand the fields here?

Take the supermarket checkout example to illustrate. How do we decide which cashier to go to when we line up at the supermarket? The first is to see the number of queues per cashier, 5 people than 20 people faster?

In addition to the number of heads, we also often look at what the front people buy things, if there is a purchase for a week, the food of the aunt, then you can consider changing a team platoon.

There is the speed of the cashier, if the money is not clear to the novice, then there are waiting.

In addition, the timing is also very important, perhaps 5 minutes before the overcrowded cash table, now is empty, this time the payment is very cool Ah, of course, the premise is that the past 5 minutes to do things than queued to make sense (but I have not found anything more boring than queuing).

I/O systems also have many similarities with supermarket queues:

    • r/s+w/s        is similar to the total number of people who have been posted

    • Avgqu-sz (average queue Length):      similar to the average number of people queued in a unit time

    • SVCTM (average service time)           similar to cashier's payment speed

    • Await (average wait time)           similar to average per person wait time

    • Avgrq-sz (average IO data)         similar to the average number of purchases per person

    • %util (disk IO usage)          is similar to the time scale at which a person is queued at the cashier.

    • If%util is close to 100%, it indicates that there are too many I/O requests and that the I/O system is full, and that the disk may have bottlenecks. The size of the

    • Svctm is generally related to disk performance, and the load on cpu/memory also affects it, and excessive requests can indirectly lead to an increase in SVCTM. The size of the

    • Await typically depends on the service time (SVCTM) and the length of the I/O queue and the emit mode of the I/O request. Generally SVCTM < await, because the waiting time for waiting requests is repeatedly computed. If SVCTM is closer to await, I/O has almost no wait time

    • If the await is much larger than SVCTM, the I/O queue is too long and the response time of the application gets slower

    • Queue Length (avgq U-SZ) can also be used as a measure of the system I/O load, but because Avgqu-sz is average per unit time, it does not reflect instantaneous I/O flooding.

    • If the response time exceeds what the user can tolerate, consider replacing a faster disk, tuning the kernel elevator algorithm, optimizing the application, or upgrading the CPU.

    • If the%util is large, and the rkb/s and wkb/s are small, generally because the disk has more disk random read and write, it is best to optimize the random read and write disk read and write.


A preliminary analysis of Linux Iostat performance

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.