分类: Mysql/postgreSQL
2015-12-18 23:36:44
原文地址:sysbench安装与使用 作者:ning_lianjie
安装文档
wget ''
yum install libtool
(libtool里面包含autoconf,automake)
configure的时候,includes目录和lib目录,mysql官方版和percona版会不一样,请按实际情况修改
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