sysbench mysqlj基准测试
1.安装 部分省略
2.sysbench --version 1.0.20
cd /usr/share/sysbench
2.1.数据准备
#sysbench --test=/usr/local/share/sysbench/oltp_write_only.lua --mysql-host=xx --mysql-port=3306 --mysql-user=xxx--mysql-password=xxx --mysql-db=test --report-interval=10 --max-requests=0 --time=120 --threads=4500 --tables=10 --table-size=100000 prepare
sysbench oltp_common.lua --time=300 --mysql-host=xxx --mysql-port=3306 --mysql-user=xxx --mysql-password=xxx --mysql-db=test --table-size=1000000 --tables=10 --threads=32 --events=999999999 prepare
2.2.运行测试
#sysbench --test=/usr/local/share/sysbench/oltp_write_only.lua --mysql-host=xxx --mysql-port=3306 --mysql-user=xxx--mysql-password=xxx --mysql-db=test --report-interval=10 --max-requests=0 --time=120 --threads=20 --tables=10 --table-size=100000 run
sysbench oltp_read_write.lua --time=300 --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=MyNewPass4! --mysql-db=sbtest --table-size=1000000 --tables=10 --threads=16 --events=999999999 --report-interval=10 run
2.3.清理数据:
#sysbench --test=/usr/local/share/sysbench/oltp_write_only.lua --mysql-host=xx --mysql-port=3306 --mysql-user=xxx--mysql-password=xxx--mysql-db=test --report-interval=10 --max-requests=0 --time=120 --threads=20 --tables=10 --table-size=100000 cleanup
sysbench oltp_read_write.lua --time=300 --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=MyNewPass4! --mysql-db=sbtest --table-size=1000000 --tables=10 --threads=16 --events=999999999 --report-interval=10 cleanup
3.注意:
数据库名称为test 需要真实存在新建
生成报告:
tps(事务/s) qps:read/requests
浙公网安备 33010602011771号