SSD Benchmarking

Using dd

Note: This method requires the command to be executed from a mounted partition on the device of interest!

First, enter a directory on the SSD with at least 1.1 GB of free space (and one that obviously gives your user wrx permissions) and write a test file to measure write speeds and to give the device something to read:

$ cd /path/to/SSD

$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc

1024+0 records in

1024+0 records out

w bytes (x GB) copied, y s, z MB/s

Next, clear the buffer-cache to accurately measure read speeds directly from the device:

# echo 3 > /proc/sys/vm/drop_caches

$ dd if=tempfile of=/dev/null bs=1M count=1024

1024+0 records in

1024+0 records out

w bytes (x GB) copied, y s, z MB/s

Now that the last file is in the buffer, repeat the command to see the speed of the buffer-cache:

$ dd if=tempfile of=/dev/null bs=1M count=1024

1024+0 records in

1024+0 records out

w bytes (x GB) copied, y s, z GB/s

Note: One should run the above command 4-5 times and manually average the results for an accurate evaluation of the buffer read speed.

Finally, delete the temp file

$ rm tempfile