IO system performance: monitors IO performance in Linux

Source: Internet
Author: User
Article Title: IO system performance: monitors IO performance in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Dd command

Dd actually works on a relatively low-Layer * nix platform tool for data copying and conversion, but because dd commands support some special devices on * nix platform, therefore, we can use this feature of the dd command to test the disk performance.

Let's talk about two related special devices.

/Dev/null

An empty device is usually used as an output device. This is a black hole in the * nix system. All content sent to this empty device disappears out of thin air.

/Dev/zero

NULL characters are usually used as input. when reading from/dev/zero, it can continuously provide null characters (ascii nul, 0 × 00.

So we have the following usage:

Test disk write

/Usr/bin/time dd if =/dev/zero of =/tmp/foo bs = 4 k count = 1024000

This command writes a 4G file to the disk file/tmp/foo. Of course, the content of the file is all null characters, at the same time, use/usr/bin/time to timing command execution. bs in the Command refers to the block size when a file is written, which is actually equivalent to the block size in Oracle, count is the number of written blocks. This method is used to test the performance of the continuous read disk when writing data, instead of the random read performance. If you cannot use this method to check the IOPS of a machine, you can only check the disk throughput.

Test disk read

/Usr/bin/time dd if =/tmp/foo of =/dev/null bs = 4 k

The preceding command reads data from the/tmp/foo file and then discards the data. bs uses the size of the block when reading the data. Like the commands written above, this test only tests the maximum read performance, not the random I/O performance.

It can also be read/written and tested at the same time.

/Usr/bin/time dd if =/tmp/foo of =/tmp/foo2 bs = 4 k

In the preceding command, the time command is used to timing the operation so that the operation can be correctly judged. One thing to remember is that the dd command can only provide a rough test. Through this simple command, you can have a rough understanding of the maximum performance of the disk system, for more details, see other methods.

Topiostat command

Top understand iostat output

In Linux, we execute an iostat-x command, and we can see the following output:

$ Iostat-x

Linux 2.4.21-50a6smp (linux) 11/03/2009

Avg-cpu: % user % nice % sys % iowait % idle

0.42 0.00 0.26 0.47 98.86

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

Hdc 0.01 0.00 0.00 0.00 0.07 0.00 0.03 0.00 24.48 0.00 4.90 4.57 0.00

Hda 0.89 8.54 0.74 4.49 12.60 104.22 6.30 52.11 22.32 0.03 5.41 1.01 0.53

Let's first list a brief description of each performance indicator.

Rrqm/s

The number of merge read operations per second.

Wrqm/s

The number of write operations performed by merge per second.

R/s

The number of read I/O devices per second.

W/s

The number of write I/O devices per second.

Rsec/s

Number of read sectors per second.

Wsec/s

Number of write sectors per second.

RkB/s

The number of bytes read per second.

WkB/s

Number of bytes written per second.

Avgrq-sz

Average data size (slice) of each device I/O operation ).

Avgqu-sz

Average I/O queue length.

Await

The average wait time (in milliseconds) for each device I/O operation ).

Svctm

The average service time (in milliseconds) for each device I/O operation ).

% Util

The amount of time in one second is used for I/O operations, or the number of I/O queues in one second is not empty.

[1] [2] Next page

Related Article

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.