The current mode of mechanical disk operation, mainly reflected in the disk reading and writing to find the track of the process, the disk caching function for reading and writing speed is very important. Disk search process is a mechanical way, so that its random speed is significantly lower than the sequential reading and writing, generally ordinary disk IO can reach 40--60MB per second, slightly better words are about 100MB per second, in the case of multiple processes or multithreading concurrent read the disk with the increase in the number of concurrent, The IO efficiency of the disk will be reduced by a dozen.
We can use the DD command to test disk read and write speed under Linux.
Time is timed. DD for replication, read from If, write to of, if if=/dev/zero this will not produce IO, can be used to test write-only speed, if of=/dev/null this does not produce IO, can be used to test read-only speed.
BS represents the unit size of each read or write. Number of Count read and write blocks
To test write-only speed:
# time DD If=/dev/zero of=/mpc bs=8k count=1000
1000+0 Records in
1000+0 records out
8192000 bytes (8.2 MB) CO Pied, 0.0109971 s, 745 mb/sec Real 0m0.031s
user 0m0.000s
sys 0m0.010s
To test read-only conditions:
# time DD if=/mpc of=/dev/null bs=8k
1000+0 Records
on 1000+0 records out
8192000 bytes (8.2 MB) copied, 0. 0028807 s, 2.8 GB/s real 0m0.005s
user 0m0.000s
sys 0m0.000s
Test read and write situations:
# time DD if=/mpc OF=/MPC2 bs=20k
400+0 Records
on 400+0 records out
8192000 bytes (8.2 MB) copied, 0.0114427 s, 716 mb/sec real 0m0.015s
user 0m0.000s
sys 0m0.010s
PS: The greater the amount of data tested, the more accurate.
This article is from the "Technology Achievement Dream" blog, please be sure to keep this source http://weipengfei.blog.51cto.com/1511707/978801