I decided to try benchmarking MySQL 5 with Sysbench 0.4.12 but as it turned out it was not so easy task.First I followed the steps as described by the dbadojo blog:
- Download last version of Sysbench
- tar -xzvf sysbench-0.4.XX.tar.gz
- cd sysbench-0.4.XX
- ./configure && make && make install
But the compiling wasn’t done and I get a strange error:
../libtool: line 2412: Xsysbench: command not found
Thanks to the tip from randombugs.com I managed to compile it properly.Here what you have to do in short.
Edit configure.ca:
#AC_PROG_LIBTOOL
AC_PROG_RANLIB
and re-run
./autogen.sh
and your are ready to
./configure && make && make install
After successfully compiling Sysbench you have to create a database called sbtest in MySQL:
mysql -u root -p yourpassword
create database sbtest;
grant all on *.* to ‘root’@'%’;
Then you can prepare your Sysbench test and start benchmarking:
- sysbench –test=oltp –mysql-table-engine=innodb –oltp-table-size=1000000 –mysql-user=root –mysql-password=yourpassword prepare
- sysbench –num-threads=4 –max-time=900 –max-requests=500000 –test=oltp –oltp-table-size=80000000 –mysql-user=root –mysql-password=yourpassword –mysql-table-engine=innodb –oltp-test-mode=complex run > test_thrd_4.txt
- sysbench –num-threads=4 –max-time=900 –max-requests=500000 –test=oltp –oltp-table-size=80000000 –mysql-user=root –mysql-password=yourpassword –mysql-table-engine=innodb –oltp-test-mode=complex cleanup
Here how the output from test_thrd_4.txt look like:
sysbench 0.4.12: multi-threaded system evaluation benchmark
No DB drivers specified, using mysql
Running the test with following options:
Number of threads: 4Doing OLTP test.
Running mixed OLTP test
Using Special distribution (12 iterations, 1 pct of values are returned in 75 pct cases)
Using “BEGIN” for starting transactions
Using auto_inc on the id column
Maximum number of requests for OLTP test is limited to 500000
Threads started!
Time limit exceeded, exiting…
(last message repeated 3 times)
Done.OLTP test statistics:
queries performed:
read: 2541588
write: 907710
other: 363070
total: 3812368
transactions: 181528 (201.68 per sec.)
deadlocks: 14 (0.02 per sec.)
read/write requests: 3449298 (3832.30 per sec.)
other operations: 363070 (403.38 per sec.)Test execution summary:
total time: 900.0583s
total number of events: 181528
total time taken by event execution: 3597.9221
per-request statistics:
min: 0.00ms
avg: 19.82ms
max: 484.69ms
approx. 95 percentile: 118.68msThreads fairness:
events (avg/stddev): 45382.0000/149.29
execution time (avg/stddev): 899.4805/0.02
For more information on all possible input parameters and test types you can check the Sysbench manual page . I hope this helps and wish you successful benchmarking !
Related posts:

One Trackback
[...] covered running sysbench against MySQL on EC2 however not specifically used sysbench to test IO. …Running Sysbench 0.4.12 on Ubuntu 9.04I decided to try benchmarking MySQL 5 with Sysbench 0.4.12 but as it turned out it was not so easy [...]