How do I test disk throughput?


There is a rather simple way of testing disk throughput using the conversion and copy tool, dd. For example, you can test the write throughtput of /playpen1 using:

dd if=/dev/zero of=/playpen4/junk bs=4k count=125000

This command will create a file junk in /playpen1, writing as fast as possible 125,000 blocks of 4 KB (500 MB), and print out a report like the following one

fhernand@titus (fhernand)$ dd if=/dev/zero of=/playpen1/junk bs=4k count=125000
125000+0 records in
125000+0 records out
512000000 bytes transferred in 22.151058 secs (23114020 bytes/sec)

This test shows a write throughput of 23 MB/s. In my test, using FreeBSD 4.x, I have observed that some machines achieve peak throughput with a block size of 512 bytes, while others require 1 KB. Performance does not degrade with larger block size, so 4 KB is a good choice for general testing, but you may want to try a few different values.

Other tests

See ~fhernand/src/sysadmin/disks for other programs that try to test things like I/O burstiness.

Felix Hernandez
Last modified: Wed Jul 16 16:10:03 EDT 2003