The speed of a displace is measured inwards price of how much information it tin read or write inwards unit of measurement time. The dd
ascendancy is a elementary ascendancy draw of piece of employment tool that tin survive used to read as well as write arbitrary blocks of information to a displace as well as stair out the speed at which the information transfer took place.
In this post service nosotros shall purpose the dd
ascendancy to exam as well as read as well as write speed of SSD as well as USB drives on Linux using the dd
command.
The information transfer speed does non depend exclusively on the drive, but also on the interface it is connected to. For illustration a USB 2.0 port has a maximum operational speed bound of 35 Mbytes/s, as well as thence fifty-fifty if you lot were to plug a high speed USB three pen displace into a USB two port, the speed would survive capped to the lower limit.
The same applies to SSD. SSD connect via SATA ports which direct hold dissimilar versions. Sata 2.0 has a maximum theoretical speed bound of 3Gbits/s which is roughly 375 Mbytes/s. Whereas Sata 3.0 supports twice that speed.
Test Method
Mount the displace as well as navigate into it from the terminal. Then purpose the dd
ascendancy to showtime write a file using fixed sized blocks. Then read the same file out using the same block site.
The full general syntax of the dd
ascendancy looks similar this
dd if=path/to/input_file of=/path/to/output_file bs=block_size count=number_of_blocks
When writing to the drive, nosotros merely read from /dev/zero
which is a rootage of interplanetary space useless bytes. And when read from the drive, nosotros read the file written before as well as shipping it to /dev/null
which is nowhere. In the whole process, dd keeps rail of the speed alongside which the transfer takes house as well as reports it.
SSD
The SSD that nosotros are using is a “Samsung Evo 120GB” SSD. It is a beginner rate SSD that comes within a decent budget as well as is also my showtime SSD. It is also 1 of the best performing SSD’s inwards the market.
In this exam the SSD is connected to a SATA 2.0 port.
Write speed
Lets showtime write to the ssd
$ dd if=/dev/zero of=./largefile bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 4.82364 s, 223 MB/s
Block size is truly quite large. You tin assay alongside smaller sizes similar 64k or fifty-fifty 4k.
Read speed
Now read dorsum the same file. However, showtime clear the retention cache to ensure that the file is truly read from drive.
Run the next ascendancy to clear the retention cache
$ sudo sh -c "sync && echo three > /proc/sys/vm/drop_caches"
Now read the file
$ dd if=./largefile of=/dev/null bs=4k
165118+0 records in
165118+0 records out
676323328 bytes (676 MB) copied, 3.0114 s, 225 MB/s
The Arch Linux wiki has a page total of information most the read/write speed of diverse SSD’s from dissimilar vendors similar Intel, Samsung, Sandisk etc. Check it out at the next url.
https://wiki.archlinux.org/index.php/SSD_Benchmarking
USB
In this exam nosotros shall stair out the read as well as write speed of ordinary USB/PEN drives. The drives are plugged to measure USB two ports. The showtime 1 is a Sony 4GB USB displace as well as the minute is a strontium 16GB drive.
First plug the displace into the port as well as mountain it, as well as thence that it is readable. Then navigate into the mountain directory from the ascendancy line.
Sony 4GB – Write
In this test, the dd
ascendancy is used to write 10,000 chunks of viii Kbyte each to a unmarried file on the drive.
# dd if=/dev/zero of=./largefile bs=8k count=10000
10000+0 records in
10000+0 records out
81920000 bytes (82 MB) copied, 11.0626 s, 7.4 MB/s
So the write speed is some 7.5 MBytes/s. This is a depression figure.
Sony 4GB – Read
The same file is read dorsum to exam the read speed. Run the next ascendancy to clear the retention cache
$ sudo sh -c "sync && echo three > /proc/sys/vm/drop_caches"
Now read the file using the dd
command
# dd if=./largefile of=/dev/null bs=8k
8000+0 records in
8000+0 records out
65536000 bytes (66 MB) copied, 2.65218 s, 24.7 MB/s
The read speed comes out some 25 Mbytes/s which is a to a greater extent than or less the measure for inexpensive usb drives.
USB 2.0 has a theoretical maximum signaling charge per unit of measurement of 480 Mbits/s or lx Mbytes/s. However due to diverse constraints the maximum throughput is restricted to some 280 Mbit/s or 35 Mbytes/s. Beyond this the actual speed achieved depends on the lineament of the pen drives as well as other factors too.
And the to a higher house USB displace was plugged within a USB 2.0 port as well as it achieved a read speed of 24.7 MBytes/s which is non really bad. But the write speed lags much behind
Now lets produce the same exam alongside a Strontium 16GB drive. Strontium is some other really cheapy brand, although USB drives are reliable.
Strontium 16GB write speed
# dd if=/dev/zero of=./largefile bs=64k count=1000
1000+0 records in
1000+0 records out
65536000 bytes (66 MB) copied, 8.3834 s, 7.8 MB/s
Strontium 16gb read speed
# sudo sh -c "sync && echo three > /proc/sys/vm/drop_caches"
# dd if=./largefile of=/dev/null bs=8k
8000+0 records in
8000+0 records out
65536000 bytes (66 MB) copied, 2.90366 s, 22.6 MB/s
The read speed is lower than the Sony drive.
Resources
http://en.wikipedia.org/wiki/USB
https://wiki.archlinux.org/index.php/SSD_Benchmarking