sysbench测试mysql性能:
安装 sysbench 0.5:
apt-get install bzr automake libtool libmysqlclient-dev
ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20.3.14 /usr/lib/libmysqlclient_r.so
bzr branch lp:sysbench
cd sysbench/
./autogen.sh
./configure
make && make install
OLTP(数据库服务器性能)测试:
测试准备:
/usr/local/bin/sysbench --test=./sysbench/sysbench/tests/db/oltp.lua --mysql-table-engine=innodb --mysql-host=10.0.1.5 --mysql-db=ming --oltp-table-size=500000 --mysql-user=ming --mysql-password=xxxxx prepare
测试:
/usr/local/bin/sysbench --num-threads=10 --test=./sysbench/sysbench/tests/db/oltp.lua --mysql-table-engine=innodb --mysql-host=10.0.1.5 --mysql-db=ming --oltp-table-size=500000 --mysql-user=ming --mysql-password=xxxx run
清理测试生成的测试表: