Testing Filesystem Performance with Bonnie++
Bonnie++ is a benchmark utility designed to test performance of hard drives and filesystems by simulating various types of disk I/O. Bonnie++ may be used to test local disks as well as network-mounted filesystems. It is recommended that you reboot your server in single-user mode (with network support, if necessary) to avoid resource contention that may skew the benchmark results. For more reliable test results, it is further advised that the amount of data Bonnie++ writes to the filesystem be at least equal to twice the amount of installed RAM.
Download the latest version of Bonnie++ from the developer’s site and compile it directly on the server. As with most benchmarking tools, it is important to compile Bonnie++ directly on the system where it will be running to ensure accurate test results.
cd /tmp wget http://www.coker.com.au/bonnie++/bonnie++-1.03e.tgz gzip -d bonnie++-1.03e.tgz tar xvf bonnie++-1.03e.tar cd bonnie++-1.03e ./configure make make install |
Here is the example command for running Bonnie++ as root. In this case the command will automatically determine the amount of RAM your server has and will set the file size to twice as much. The filesystem being tested is /tmp.
bonnie++ -n 0 -u 0 -r `free -m | grep 'Mem:' | awk '{print $2}'` -s $(echo "scale=0;`free -m | grep 'Mem:' | awk '{print $2}'`*2" | bc -l) -f -b -d /tmp |
Depending on the amount of RAM your system has, this test may take a long time to complete. Here is the sample output:
Version 1.03e ------Sequential Output------ --Sequential Input- --Random- -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks-- Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP node48 31736M 172687 46 84284 25 208202 45 540.9 1 node48,31736M,,,172687,46,84284,25,,,208202,45,540.9,1,,,,,,,,,,,,, |
In this example, a total of 31Gb of data was written to the disk. The sequential write performance was 169Mb/s, sequential re-write was 82Mb/sec, and sequential read was 203 Mb/s. The last line shows the results in a comma-separated format useful for importing the data into a spreadsheet application or a database.
Popularity: 7% [?]
Related posts:



[...] the following example we run bonnie++ – a popular filesystem testing utility for Linux and Unix – on a system with 512Mb of [...]
[...] This can be especially impacting if your data storage is network-mounted. You can use “bonnie++” or rsync on a network-mounted filesystem to test network throughput. You can read about [...]
Thanks for an excellent example of using Bonnie++
[Reply]