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.
Here are two methods of testing:
(1) using the Hdparm command
This is a command that is used to obtain the parameters of the ata/ide hard drive, written by the development and maintenance personnel of the early Linux IDE driver Mark Lord (Hdparm have been written by Mark Lord, the primary Develo Per and maintainer of the (E) IDE driver for Linux, with suggestions from many netfolk). This command should also be used only for Linux systems, for UNIX systems, Ata/ide hard Disks may be less, and generally large systems use disk arrays.
The way to use it is simple
# Hdparm-tt/dev/[email Protected]>
/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 the 19214mb file 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