WintelGuy.com
Simple disk throughput tests using dd utility

Disk throughput on a Linux/UNIX system can be tested using a "built in" file copy utility - dd. The output from dd shows disk read or write throughput based on the number of bytes copied and time spent.

For example, the following command shows write throughput:

# dd if=/dev/zero of=/root/testfile bs=64K count=100000
100000+0 records in
100000+0 records out
6553600000 bytes (6.6 GB) copied, 72.215 s, 90.8 MB/s

Where:
if=/dev/zero - data source;
of=/root/testfile - target file;
bs=64K - number of bytes to read/write at a time ("block size");
count=100000 - number of blocks to read/write.

Read throughput can be evaluated by using the testfile created in the previous example as the source:

# dd if=/root/testfile of=/dev/null bs=64K count=100000
100000+0 records in
100000+0 records out
6553600000 bytes (6.6 GB) copied, 69.8647 s, 93.8 MB/s


To get more accurate result create a script including dd and sync commands and then execute the script using the time command.

# more ddscript
#!/bin/bash
#
dd if=/dev/zero of=/root/testfile bs=64K count=100000
sync
#
# /usr/bin/time ./ddscript
100000+0 records in
100000+0 records out
6553600000 bytes (6.6 GB) copied, 72.8249 s, 90.0 MB/s
0.04user 10.86system 1:13.66elapsed 14%CPU (0avgtext+0avgdata 4560maxresident)k
328inputs+12808328outputs (3major+821minor)pagefaults 0swaps
#

To calculate the throughput divide the number of bytes reported by dd by the elapsed time reported by time:
6553600000 bytes / 1:13.66 = 6553600000 bytes / 73.66 s = 88970947.6 bytes/s = 88.97 MB/s or 84.85 MiB/s

For Windows users - there is always Iometer.