$ sudo apt-get install automake
$ sudo apt-get install libtool
$ sudo apt-get install libmysqlclient-dev
$ sudo apt-get install libssl1.0.0 libssl-dev
-
Downloads SysBench 0.5 (i.e. sysbench_0.5.orig.tar.gz) from Percona repositories.
-
Untar the sysbench tar file.
$ tar -xvf sysbench_0.5.orig.tar.gz
- Go to the SysBench directory and run following commands.
$ ./autogen.sh
$ ./configure
$ make
$ make install
If you have MySQL headers and libraries in non-standard locations (and no mysql_config can be found in the PATH), you can specify them explicitly with --with-mysql-includes
and --with-mysql-libs
options to ./configure
like below example.
$ ./configure --with-mysql-includes=/home/mijin/mysql-5.6.26/include --with-mysql-libs=/home/mijin/mysql-5.6.26/lib
- Now you can run SysBench 0.5 using
sysbench
command.
- Before running the benchmark, you should create a database for SysBench test. For example:
$ mysql -uroot
root:(none)> create database sbtest;
root:(none)> quit
- Then,
prepare
the test. At theprepare
stage, SysBench performs preparative actions for those tests which need them. (e.g. creating the necessary files on disk for the fileio test, or filling the test database for the oltp test)
$ sysbench --test=/home/mijin/sysbench-0.5/sysbench/tests/db/oltp.lua \
--mysql-host=localhost --mysql-db=sbtest --mysql-user=root \
--max-requests=0 --oltp-table-size=1000000 \
--max-time=600 --oltp-tables-count=200 --report-interval=10 \
--db-ps-mode=disable --random-points=10 --mysql-table-engine=InnoDB \
--mysql-port=3307 --num-threads=128 prepare
- Now, we can run the actual test.
$ sysbench --test=/home/mijin/sysbench-0.5/sysbench/tests/db/oltp.lua \
--mysql-host=localhost --mysql-db=sbtest --mysql-user=root \
--max-requests=0 --oltp-table-size=1000000 \
--max-time=600 --oltp-tables-count=200 --report-interval=10 \
--db-ps-mode=disable --random-points=10 --mysql-table-engine=InnoDB \
--mysql-port=3307 --num-threads=128 run
You can get more information from SysBench manual and SysBench Github repository.
If you get an error message as follows:
$ sysbench
sysbench: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
Export the LD_LIBRARY_PATH variable.
export LD_LIBRARY_PATH=/path/to/mysql/lib/