To test disk read and write speed with the DD command under Linux

Source: Internet
Author: User
Tags linux

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

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.