The dd
command can be used to test disk I/O performance on Linux and Unix systems. Here’s an example of how to use it:
- Create a test file with a specified size and block size:
dd if=/dev/zero of=testfile bs=1M count=1024
This creates a file named “testfile” of 1 GB (1024 MB) in size, with a block size of 1 MB.
- Read the test file and measure the time it takes:
time dd if=testfile of=/dev/null bs=1M
The
time
command is used to measure the elapsed time for thedd
command to read the test file. - Analyze the output of the
time
command to get an estimate of disk I/O performance. Look for the value of “bytes transferred” and “time elapsed”. Divide the “bytes transferred” by the “time elapsed” to get an estimate of the disk I/O performance in MB/s.
Note: You can adjust the size of the test file, block size, and input/output file paths to suit your specific testing needs.