http://sysbench.sourceforge.net/
安装文档http://sysbench.sourceforge.net/docs/#install
yum install libtool libsysfs-devel -y
(libtool里面包含autoconf,automake)
configure的时候,includes目录和lib目录,mysql官方版和percona版会不一样,请按实际情况修改
make 之前将安装好的libtool 替换掉sysbench中的libtool
否则会报
../libtool: line 838: X--tag=CC: command not found
../libtool: line 871: libtool: ignoring unknown tag : command not found
tar zxvf sysbench-0.4.12.tar.gz
cd sysbench-0.4.12
./autogen.sh
./configure --with-mysql --with-mysql-includes=/home/q/mysql_3306/include/mysql --with-mysql-libs=/home/q/mysql_3306/lib/mysql
make
make install
使用问题
[root@l-hoteldb1.h.cn2 /tmp]# sysbench
sysbench: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
[root@l-hoteldb1.h.cn2 /tmp]# ln -s /home/q/mysql_3306/lib/libmysqlclient.so.18 /usr/lib64/
一,fileio
Usage example:
$ sysbench --num-threads=16 --test=fileio --file-total-size=3G --file-test-mode=rndrw prepare
$ sysbench --num-threads=16 --test=fileio --file-total-size=3G --file-test-mode=rndrw run
$ sysbench --num-threads=16 --test=fileio --file-total-size=3G --file-test-mode=rndrw cleanup
二,oltp
Example usage:
$ sysbench --test=oltp --mysql-table-engine=myisam --oltp-table-size=1000000 --mysql-socket=/tmp/mysql.sock --mysql-db=test prepare
$ sysbench --num-threads=16 --max-requests=100000 --test=oltp --oltp-table-size=1000000 --mysql-socket=/tmp/mysql.sock --oltp-read-only run
$ sysbench --test=oltp --mysql-table-engine=myisam --oltp-table-size=1000000 --mysql-socket=/tmp/mysql.sock --mysql-db=test cleanup