Disk benchmarking – Bonnie++ (OpenSUSE 13.1)

If you think that simple „dd bs=1M count=512 if=/dev/zero of=test conv=fdatasync“ disk benchmarking is not enough – you’re completely right. There are not so many tools benchmarking your disk, one of the most used is Bonnie++.

Outputs after downloading source code from home page, unpacking and running „3 golden commands“ :

linux-fot6:/home/ji/Downloads/bonnie++-1.03e # ./configure
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
checking for g++… g++
checking for C++ compiler default output file name… a.out
checking whether the C++ compiler works… yes
checking whether we are cross compiling… no
checking for suffix of executables…
checking for suffix of object files… o
checking whether we are using the GNU C++ compiler… yes
checking whether g++ accepts -g… yes
checking how to run the C++ preprocessor… g++ -E
checking for a BSD-compatible install… /usr/bin/install -c
checking for an ANSI C-conforming const… yes
checking for grep that handles long lines and -e… /usr/bin/grep
checking for egrep… /usr/bin/grep -E
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking for size_t… yes
checking vector.h usability… no
checking vector.h presence… no
checking for vector.h… no
STL not installed so no ZCAV!
checking vector usability… yes
checking vector presence… yes
checking for vector… yes
checking algorithm usability… yes
checking algorithm presence… yes
checking for algorithm… yes
checking algo.h usability… no
checking algo.h presence… no
checking for algo.h… no
checking algo usability… no
checking algo presence… no
checking for algo… no
configure: creating ./config.status
config.status: creating Makefile
config.status: WARNING: Makefile.in seems to ignore the –datarootdir setting
config.status: creating bonnie.h
config.status: creating port.h
config.status: creating bonnie++.spec
config.status: creating bon_csv2html
config.status: creating bon_csv2txt
config.status: creating sun/pkginfo
config.status: creating conf.h
config.status: conf.h is unchanged
linux-fot6:/home/ji/Downloads/bonnie++-1.03e # make
g++ -O2 -DNDEBUG -Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope -c bon_io.cpp
g++ -O2 -DNDEBUG -Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope -c bon_file.cpp
g++ -O2 -DNDEBUG -Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope -c bon_time.cpp
g++ -O2 -DNDEBUG -Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope -c semaphore.cpp
g++ -O2 -DNDEBUG -Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope -c forkit.cpp
g++ -O2 -DNDEBUG -Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope -c bon_suid.cpp
g++ -O2 -DNDEBUG -Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope bonnie++.cpp -o bonnie++ bon_io.o bon_file.o bon_time.o semaphore.o forkit.o bon_suid.o
bonnie++.cpp:159:8: warning: unused parameter ‘sig’ [-Wunused-parameter]
void ctrl_c_handler(int sig
bonnie++.cpp:159:8: warning: unused parameter ‘unused’ [-Wunused-parameter]
g++ -O2 -DNDEBUG -Wall -W -Wshadow -Wpointer-arith -Wwrite-strings -pedantic -ffor-scope zcav.cpp -o zcav bon_suid.o
linux-fot6:/home/ji/Downloads/bonnie++-1.03e # make install
mkdir -p /usr/local/bin /usr/local/sbin
/usr/bin/install -c -s bonnie++ zcav /usr/local/sbin
/usr/bin/install -c bon_csv2html bon_csv2txt /usr/local/bin
mkdir -p /usr/local/share/man/man1 /usr/local/share/man/man8
/usr/bin/install -c -m 644 bon_csv2html.1 bon_csv2txt.1 /usr/local/share/man/man1
/usr/bin/install -c -m 644 bonnie++.8 zcav.8 /usr/local/share/man/man8
linux-fot6:/home/ji/Downloads/bonnie++-1.03e # bon
bon_csv2html bon_csv2txt bonnie++ bonobo-activation-run-query bonobo-activation-sysconf bonobo-slay
linux-fot6:/home/ji/Downloads/bonnie++-1.03e # bonnie++
You must use the „-u“ switch when running as root.
usage: bonnie++ [-d scratch-dir] [-s size(MiB)[:chunk-size(b)]]
[-n number-to-stat[:max-size[:min-size][:num-directories]]]
[-m machine-name]
[-r ram-size-in-MiB]
[-x number-of-tests] [-u uid-to-use:gid-to-use] [-g gid-to-use]
[-q] [-f] [-b] [-D] [-p processes | -y]

Version: 1.03e

As you can see from last message, whole benchmark is controllable via command line. According recommendation I’m using -n 1024 (number of files), whole line can be similar to:

linux-fot6:~ # bonnie++ -u ji -d /tmp/bench -n 1024

As I’m running bonnie from root, I have to specify common user (-u ji). Output:

linux-fot6:~ # bonnie++ -u ji -d /tmp/bench -n 1024
Using uid:1000, gid:100.
Writing with putc()…done
Writing intelligently…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
linux-fot6.s 31960M 105174  98 468152  34 212857  18 109460  98 649174  40 +++++ +++
                    ——Sequential Create—— ——–Random Create——–
                    -Create– –Read— -Delete– -Create– –Read— -Delete–
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
               1024 75103  81 967814 100 35173  38 75187  79 1124432 100 23450  31
linux-fot6:~ #

You can see output in good format, anyway if you plan to execute more tests, maybe more harddrive, etc… utility compiled with Bonnie++, bon_csv2html can be very handy:

linux-fot6:~ # echo "linux-fot6.site,31960M,105174,98,468152,34,212857,18,109460,98,649174,40,+++++,+++,1024,75103,81,967814,100,35173,38,75187,79,1124432,100,23450,31" | bon_csv2html > /tmp/speed.html

In my case, generated html file looks like:



dd bs=1M count=512 if=/dev/zero of=test conv=fdatasync – See more at: http://systembash.com/content/simple-disk-benchmarking-in-linux-using-dd/#sthash.3Hxp0pbc.dpuf
dd bs=1M count=512 if=/dev/zero of=test conv=fdatasync – See more at: http://systembash.com/content/simple-disk-benchmarking-in-linux-using-dd/#sthash.3Hxp0pbc.dpuf
This entry was posted in Linux. Bookmark the permalink.

Napsat komentář