Read/write IO speed of test disk under Linux

Source: Internet
Author: User

Sometimes when we do maintenance, there will always be similar to the IO is particularly high, but can not be determined to be an IO bottleneck or improper setting of software parameters caused hot disk problems. This is usually the time to know the disk read and write speed, to make the next decision.

(1) Use the hdparm command
this is a command to get the parameters of a ata/ide hard disk, a development and maintenance person driven by an earlier Linux IDE Mark Lord developed (Hdparm have been written by Mark Lord <[email protected]>, the primary developer and maintainer of th E (E) IDE driver for Linux, with suggestions from many netfolk). This command should also be used only for Linux systems, and for UNIX systems, the Ata/ide drive may be less, Typically, large systems use disk arrays.

easy to use

/DEV/SDA:
Timing cached reads:6676 MB in 2.00 seconds = 3340.18 mb/sec
Timing buffered disk reads:218 MB in 3.11 seconds = 70.11 mb/sec


Can be seen, 2 seconds read the 6676MB cache, about 3340.18 mb/sec;
Read 218MB disk (physical read) in 3.11 seconds, read speed approx. 70.11 mb/sec

(2) using the DD command
This is not a professional testing tool, but if the test results are not very demanding, you can usually use to make a simple evaluation of the disk read and write speed.
In addition, because this is a free software, basically Xnix system is installed, for the replication of Oracle bare devices, DD tools are generally preferred.

Get to know two special devices before use
/dev/null pseudo-device, Recycle Bin. Writing the file does not generate IO
/dev/zero pseudo-device generates an empty character stream, which does not produce IO

Test method:
A. Test disk IO write speed
# time DD If=/dev/zero of=/test.dbf bs=8k count=300000
300000+0 Records in
300000+0 Records out
10.59s Real 0.43s User 9.40s system
# DU-SM/TEST.DBF
2347/test.dbf

Can see, in 10.59 seconds time, generate 2347M of a file, Io write speed about 221.6mb/sec;
Of course, this speed can be tested several times to take an average, in line with probability statistics.

b. Test disk IO Read speed
# df-m
filesystem 1m-blocks used Available use% mounted on
/DEV/MAPPER/VOLGROUP00-LOGVOL00
19214 9545 8693 53%/
/DEV/SDA1 14%/boot
none 506 0 506 0%/dev/shm

# time DD if=/dev/mapper/volgroup00-logvol00 of=/dev/null bs=8k
2498560+0 Records IN
2498560+0 Records out
247.99s Real 1.92s User 48.64s system

The above experiment reads 19214MB files in 247.99 seconds and calculates the average speed of 77.48mb/sec

C. Test IO simultaneous read and write speed
# time DD if=/dev/sda1 of=test.dbf bs=8k
13048+1 Records in
13048+1 Records out
3.73s Real 0.04s User 2.39s system
# DU-SM TEST.DBF
103 TEST.DBF

The amount of data tested above is small and is used only as a reference.


Compared to two methods:
The former is a professional tool for testing ide/ata disks on Linux, but the scope of use is limited; (This experiment uses only the parameters of test disk IO, for other parameters and explanation reference Man manual)
The latter can be generic, but not professional, and do not take into account the cache and physical reading of the distinction, testing data is only for reference, not considered authoritative.

Read/write IO speed of test disk under Linux

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.