Download bonnie++ tarball from http://www.coker.com.au/bonnie++/
Extract and install it:
# tar -xvzf bonnie++-XXX.tgz
# cd bonnie++-XXX
# make
Bonnie++ is a program to test hard drives and file systems for performance or the lack therof. There are a many different types of file system operations which different applications use to different degrees. Bonnie++ tests some of them and for each test gives a result of the amount of work done per second and the percentage of CPU time this took. For performance results higher numbers are better, for CPU usage lower are better (NB a configuration scoring a performance result of 2000 and a CPU result of 90% is better in terms of CPU use than a configuration delivering performance of 1000 and CPU usage of 60%).
There are two sections to the program’s operations. The first is to test the IO throughput in a fashion that is designed to simulate some types of database applications. The second is to test creation, reading, and deleting many small files in a fashion similar to the usage patterns of programs such as Squid or INN.
Just issue the following command, it should be ok for most situations:
# bonnie++ -d /testdir/ -m testname -u root -s $((2*$RAM_SIZE))
Note:
If you test want to test hard drive, you must mount it to the value of -d option. Also make sure that the hard drive size is double RAM, or you will have to specify -r option.
If you want to reduce ‘++++’ you need to increase the test time either by increasing the value of -n or by increasing the value of -s.
# bonnie++ -d ./ -m testname -u root -s 40M -r 10M
Using uid:0, gid:0.
Writing with putc()...done
Writing intelligently...done
Rewriting...done
Reading with getc()...done
Reading intelligently...done
start 'em...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...done.
Create files in random order...done.
Stat files in random order...done.
Delete files in random order...done.
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
testname 40M 54715 99 +++++ +++ +++++ +++ 51914 99 +++++ +++ +++++ +++
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 15104 99 +++++ +++ +++++ +++ 15480 99 +++++ +++ 31050 95
testname,40M,54715,99,+++++,+++,+++++,+++,51914,99,+++++,+++,+++++,+++,16,15104,99,+++++,+++,+++++,+++,15480,99,+++++,+++,31050,95
The primary output is plain-text in 80 columns which is designed to fit well when pasted into email and which will work well with Braille displays.
The second type of output is CSV (Comma Seperated Values). This can easily be imported into any spread-sheet or database program. Also it have included the programs bon_csv2html and bon_csv2txt to convert CSV data to HTML and plain-ascii respectively:
1. Select the last comma seperated line.
echo 'testname,40M,54715,99,+++++,+++,+++++,+++,51914,99,+++++,+++,+++++,+++,16,15104,99,+++++,+++,+++++,+++,15480,99,+++++,+++,31050,95' | perl bon_csv2html > results.html
For every test two numbers are reported, the amount of work done (higher numbers are better) and the percentage of CPU time taken to perform the work (lower numbers are better). If a test completes in less than 500ms then the output will be displayed as “++++”. This is because such a test result can’t be calculated accurately due to rounding errors and I would rather display no result than a wrong result.