How to install sysbench 0.5 on Debian 7

Normally, sysbench 0.4.12 version can be installed from repositories like “apt-get install sysbench” but the newer version 0.5 is not added in any repo yet (AFAIK) so, it’s bit difficult to install it.

1. Install bzr package if it’s not installed. (i.e apt-get install bzr)

2. Download the code from branch. (i.e bzr branch lp:sysbench)

root@deb-pxc56-2:~# bzr branch lp:sysbench
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data. See "bzr help launchpad-login".
Branched 122 revisions. 

3. Before you compile code from the branch, you need some of the packages to be installed If they are not.

apt-get install automake
apt-get install libtool
apt-get install libmysqlclient-dev
apt-get install libssl1.0.0 libssl-dev

4. Go to sysbench dir and run script.

root@deb-pxc56-1:~# cd /root/sysbench/
root@deb-pxc56-2:~/sysbench# ./
./ running `aclocal -I m4' 
Libtoolized with: libtoolize (GNU libtool) 2.4.2
Automade with: automake (GNU automake) 1.11.6
Configured with: autoconf (GNU Autoconf) 2.69

5. Run ./configure

root@deb-pxc56-2:~/sysbench# ./configure 
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
config.status: creating sysbench/scripting/lua/src/Makefile
config.status: creating config/config.h
config.status: executing depfiles commands
config.status: executing libtool commands

6. Run make

root@deb-pxc56-2:~/sysbench# make
Making all in doc
make[1]: Entering directory `/root/sysbench/doc'
Making all in xsl
make[2]: Leaving directory `/root/sysbench/sysbench'
make[1]: Leaving directory `/root/sysbench/sysbench'
make[1]: Entering directory `/root/sysbench'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/root/sysbench'

Now you can run sysbench 0.5 from the installation dir.

root@deb-pxc56-1:~# cd /root/sysbench/sysbench/
root@deb-pxc56-2:~/sysbench/sysbench# ./sysbench 
--oltp-table-size=100000 --mysql-db=sbtest --mysql-user=root 
--mysql-password=root prepare
sysbench 0.5:  multi-threaded system evaluation benchmark

Creating table 'sbtest1'...
Inserting 100000 records into 'sbtest1'

root@deb-pxc56-2:~/sysbench/sysbench# ./sysbench 
--oltp-table-size=100000 --oltp-tables-count=1 --num-threads=32 
--mysql-host= --mysql-user=root --mysql-password=root 
--mysql-port=3306 --report-interval=1 --max-requests=0 --max-time=0 run
WARNING: Both max-requests and max-time are 0, running endless test
sysbench 0.5:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 32
Report intermediate results every 1 second(s)
Random number generator seed is 0 and will be ignored

Threads started!

[   1s] threads: 32, tps: 0.00, reads/s: 0.00, writes/s: 23.33, 
response time: 971.94ms (95%)
[   2s] threads: 32, tps: 0.00, reads/s: 0.00, writes/s: 26.00, 
response time: 1271.31ms (95%)
[   3s] threads: 32, tps: 0.00, reads/s: 0.00, writes/s: 25.99, 
response time: 1219.13ms (95%)