Test hard disk read/write speed in linux
After buying an ssd hard disk, I want to compare it with an ordinary mechanical disk. Because the desktop is installed with the ubuntu system, I just want to use the linux Command for a simple test.
The following are ssd performance data:
Test write:
xxx@WaitFish:~ > time dd if=/dev/zero bs=1024 count=1000000 of=1Gb.file1000000+0 records in1000000+0 records out1024000000 bytes (1.0 GB) copied, 3.78724 s, 270 MB/sreal 0m3.789suser 0m0.839ssys 0m2.527s
Reads data from null to files. The block size is 1024, and the number is 1000000.
Test read:
xxx@WaitFish:~ >time dd of=1Gb.file if=/dev/zero bs=1024 count=10000001000000+0 records in1000000+0 records out1024000000 bytes (1.0 GB) copied, 3.84934 s, 266 MB/sreal 0m4.009suser 0m0.852ssys 0m2.698s
Read data from a file to null to test read performance
Below is the speed of the mechanical Disk:
Write Performance:
sudo time dd if=/dev/zero bs=1024 count=1000000 of=1Gb.file1000000+0 records in1000000+0 records out1024000000 bytes (1.0 GB) copied, 69.5384 s, 14.7 MB/s1.62user 13.84system 1:09.56elapsed 22%CPU (0avgtext+0avgdata 704maxresident)k72inputs+0outputs (2major+221minor)pagefaults 0swaps
Read performance:
Xxx @ WaitFish:/media/xx/Add volume> sudo time dd of = 1 GB. file if =/dev/zero bs = 1024 count = 10000001000000 + 0 records in1_00 + 0 records out10241_00 bytes (1.0 GB) copied, 71.2378 s, 14.4 MB/s1.66user 14.34 system. 34 elapsed 22% CPU (0 avgtext + 0 avgdata 700 maxresident) k0inputs + 0 outputs (0 major + 224 minor) pagefaults 0 swaps
It seems that the difference is not a little bit, hahaha