Use Time + dd to test hard disk read/write speed

Source: Internet
Author: User

Write speed:
TIME dd If =/dev/Zero of = test. dbf bs = 8 k count = 300000
Among them,/dev/zero is a pseudo device, which only generates a null compaction stream and does not generate Io for it. Therefore, Io will be concentrated in the of file, and the of file is only used for writing, therefore, this command is equivalent to testing the disk write capability.
The output result is similar (because the test time is generally longer and more accurate, you can set the count to be larger ):
300000 + 0 records in
300000 + 0 records out
Real 0m36. 669 s
User 0m0. 185 s
Sys 0m9. 340 s
Therefore, the write speed is 8*300000/1024/36.669 = 63.916 m/s.
Read speed:
TIME dd If =/dev/sda1 of =/dev/null BS = 8 K
Because/dev/sdb1 is a physical partition, reading it will generate Io,/dev/null is a pseudo device, which is equivalent to a black hole, of this device will not generate Io, so, the IO of this command only occurs on/dev/sdb1, which is equivalent to testing the disk's read capability.
The output result is similar:
448494 + 0 records in
448494 + 0 records out
Real 0m51. 070 s
User 0m0. 054 s
Sys 0m10. 028 s
Therefore, the reading speed on sda1 is 8*448494/1024/51.070 = 68.61 m/s.
In addition, if cygwin is installed in windows, the time and DD commands can also be used, and the output result directly contains the time and speed of Io. If you are interested, you can try it, however, I tested that the read and write speed was only over 40 m per second. I don't know if it was the platform reason. Maybe cygwin's mechanism is different from that in 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.