Saturday, February 24, 2007

Create Large Files to Test Throughput Rates

There may be occasions when you want to test the throughput rates for a large file. In our case, we wanted to use files of certain sizes to accomplish these tests. I suggested using the mkfile command to create the predetermined file sizes.

Here's what was done.

Create a 1MB file
# mkfile 1m 1MB

Create a 5MB file
# mkfile 5m 5MB

Create 10MB file
# mkfile 10m 10MB

Create 100MB file
# mkfile 100m 100MB

Create 1GB file
# mkfile 1000m 1GB

Extra: Use Z Shell brace expansion to create multiple test files


Unknown said...

Don't want to be picky but 1GB is 1024MB.

Anonymous said...

If mkfile is not available (as is the case on some Linux boxes), use dd:

$ dd if=/dev/urandom of=yourfilename bs=1M count=100