Skip to main content

bonnie++ and the -n switch

Maybe I'm st00pid, but the -n switch in bonnie++ always confused me. While other switches like -s or -r expect "megabyte", -n is a bit different:

# bonnie++ -d /mnt/disk -s 128 -b -n 8:1048576:1024:1 -m `uname -n`
Apparently the -s 128(MB) is only used for I/O performance. I/O as in throughput only. It has nothing to do with the file creation tests, that's what -n is for:
-n 8       - multiples of 1024, we'll create 8192 files here 
   1048576 - max filesize in bytes - 1MiB here
   1024    - min filesize in bytes - 1KiB here
   1       - spread files evenly across that many subdirectories
So, in our case, bonnie++ would create 8192 files à 1MiB (max) files in one directory, which sums up to 8 GiB. Gotta remember that now. Grrr.