Bonnie++ (http://www.coker.com.au/bonnie++/) is “a benchmark suite that is aimed at performing a number of simple tests of hard drive and file system performance.” Bonnie++ outputs a 80-column display report (to fit on braille keyboards), as well as csv values that can be converted to text or HTML (with bon_csv2txt and bon_csv2html, respectively).
Bonnie++ provides performance metrics on the following 3 things:
- Data read and write speed: This should be fairly obvious. This is how fast you can read and write to the drive(s) in question.
- Maximum number of seeks per second: If the blocks that your computer needs are not sequentially stored (right next to each other), then the heads in the HD will have to do a seek (physically moves the heads to the right platter).
- Maximum number of file metadata operations per second: Metadata operations include things like file creation, deletion, or gathering any other metadata about a file (permissions, size, etc).
In order to run all of the tests included, I ran the following command:
# bonnie++ -u 0 -r 1024 -s 20480 -n 256 -b -d /
Let’s break down the parameters passed to bonnie++:
- -u 0: The -u flag is used to indicated the UID that the test should run as. UID 0, as we all know, belongs to the root user.
- -r 1024: The -r flag is used to indicate how much RAM (in megabytes) is in the machine. As you can see I have 1gb (1024mb).
- -s 20480: The -s flag is used to indicate the size of the file(s) (in megabytes) to be used for IO performance testing. More on this value later.
- -n 256: Specifies the number of files for the file creation test. This is in multiples of 1024 files, so 256 = 252,144 (256*1024) files.
- -b: The -b flag is used to disable any system-level buffering. Basically this means an fsync() is called after every write operation.
- -d /: The -d flag is used to indicate the path on which to perform the tests.
Of all the runtime parameters, -s is probably the most important to define properly. This flag (in megabytes) defines the size of the files used for IO performance benchmarking. If the supplied size is greater than 1gb, then multiple 1gb files will be used until the value is reached. In order to get proper results, you will want to specify a number much larger than the amount of RAM you have. If possible, use a much higher multiple, like 20x. To be sure to bypass any caching done by the hardware, you want at least 2-3x the amount of RAM.