sysbench压力测试MySQL

软件下载地址:
https://github.com/akopytov/sysbench


安装依赖
yum install automake libtool –y


安装
./autogen.sh
./configure
make
make install


验证是否安装成功
sysbench --version


准备数据
mysql -uroot  -pJimstars -h10.10.10.62 -P3306 -e " create database sbtest"
 
sysbench ./tests/include/oltp_legacy/oltp.lua --mysql-host=10.10.10.62 --mysql-port=3306 --mysql-user=root --mysql-password=Jimstars --oltp-test-mode=complex --oltp-tables-count=10 --oltp-table-size=100000 --threads=10 --time=120 --report-interval=10 prepare         

 
执行测试
sysbench ./tests/include/oltp_legacy/oltp.lua --mysql-host=10.10.10.62 --mysql-port=3306 --mysql-user=root --mysql-password=Jimstars --oltp-test-mode=complex --oltp-tables-count=10 --oltp-table-size=100000 --threads=10 --time=120 --report-interval=10 run  > /tmp/mysysbench.log


清理数据
执行完测试后,清理数据,否则后面的测试会受到影响
sysbench ./tests/include/oltp_legacy/oltp.lua --mysql-host=10.10.10.6 --mysql-port=3306 --mysql-user=root --mysql-password=Jimstars cleanup


 

posted @ 2021-03-10 11:28  屠魔的少年  阅读(3)  评论(0)    收藏  举报