IO read and write speed test linux disk - simple method

Reference:
https://blog.csdn.net/zqtsx/article/details/25487185


A: Use hdparm command


   This is a command is used to get ATA / IDE hard disk parameters, by early Linux IDE-driven development and maintenance staff Mark Lord development written (hdparm has been written by Mark Lord <[email protected]>, the primary developer and maintainer of the (E) IDE driver for Linux, with suggestions from many netfolk). this command should only be used also Linux systems, for UNIX systems, ATA / IDE hard disk may be relatively small, large systems are generally the use of a disk array

is very simple to
[the root my1-222 @ ~] # hdparm -Tt / dev / sda3

/ dev / sda3:
 the Timing the reads cached: 13034 in 2.00 seconds the MB = 6527.09 MB / sec
 the Timing the reads buffered disk: 194 = 34.64 in 5.60 seconds the MB MB / sec
[my1-222 the root @ ~] #

can be seen, the cache read 13034MB 2 seconds and about 6527.09 MB / sec;
read 194MB disks (3.11 seconds in the physical read), the reading speed of about 4.64 MB / sec

II: Use dd command

  This is not a professional test tools, but if the requirements for the test results are not very harsh words, who are able to make use of a simple assessment of the read and write speed of the disk. In addition, as this is a free software, basically on × NIX system have installed.

First understand the two special device

/ dev / null pseudo device, the file will not have to write the Recycle Bin IO.
/ Dev / ZERO pseudo device, will produce an empty character stream, it will not produce IO

test methods:
. A test disk IO write speed
 

   Time dd IF = / dev / ZERO of Test.dbf bs = 8k = COUNT = 300000 # If you want to test the actual speed even at the end add oflag = direct measurement of the speed is real IO

 


b. Disk IO read speed test
 

  dd if=test.dbf bs=8k count=300000 of=/dev/null 

 



   # Indicates every write / read data 8k, the execution 300000

dd command can be generic, but not very professional, did not take into account the distinction between physical cache and read, the test data is for reference only, can not be regarded as authoritative.

Copy the code
[root@my1-222 ~]# time dd if=/dev/zero of=test.dbf bs=8k count=300000
300000+0 records in 300000+0 records out 2457600000 bytes (2.5 GB) copied, 2.50417 s, 981 MB/s real 0m2.537s user 0m0.023s sys 0m2.070s [root@my1-222 ~]# time dd if=/dev/zero of=test.dbf bs=8k count=300000 oflag=direct 300000+0 records in 300000+0 records out 2457600000 bytes (2.5 GB) copied, 25.4357 s, 96.6 MB/s real 0m25.550s user 0m0.010s sys 0m13.655s [root@my1-222 ~]# [root@my1-222 ~]# dd if=test.dbf bs=8k count=300000 of=/dev/null 300000+0 records in 300000+0 records out 2457600000 bytes (2.5 GB) copied, 1.94773 s, 1.3 GB/s [root@my1-222 ~]# 
Copy the code

 



dd command interpreter

dd if = of = bs = skip = seek = conv =

must not confuse the source and target, otherwise data will be lost. So dd usually with a handy call it dd, but accidentally did not get the data in relation to the crying call it Data Destroyer.

Its parameters are generally used:

BS = n-, Block size, n-bytes per write read, can be combined with the count;
IBS = n-, bytes read into bytes (default IS 512);
OBS = n-, The write-once bytes n bytes (default IS 512);
BS may set the upper two parameters simultaneously;
CBS = n, a conversion of n bytes, i.e., the conversion buffer size. ;
N, the number of operations bs count =, copy only n blocks, such as DVD: bs = 1M COUNT = 4430;
Skip = n, if the latter refers to the original document n bytes to skip before starting reading;
Seek = n, means behind the target file of n bytes to skip before starting writing;   

tests simultaneously reading and writing speed IO

Copy the code
[root@my1-222 ~]# time dd if=/dev/sda1 of=test.dbf bs=8k count=300000
25600+0 records in 25600+0 records out 209715200 bytes (210 MB) copied, 2.23626 s, 93.8 MB/s real 0m2.394s user 0m0.002s sys 0m0.352s [root@my1-222 ~]# 
Copy the code

 



(Test write speed while generating a file size of 200M of test.dbf)

smaller than the above test data, as a reference only.

Guess you like

Origin www.cnblogs.com/kangleweb/p/10949094.html