下载安装:
yum install sysbench
检验安装是否成功:
sysbench --version
创建测试数据库:
mysql>create database sbtest;
准备:
sysbench --test=/usr/share/sysbench/oltp_point_select.lua --tables=1 --table-size=200000 --threads=16 --time=120 --report-interval=3 --mysql-user=root --mysql-password=root --mysql-host=192.168.0.226 --max-requests=0 --mysql-db=sbtest prepare
运行:
sysbench --test=/usr/share/sysbench/oltp_point_select.lua --tables=1 --table-size=200000 --threads=16 --time=120 --report-interval=3 --mysql-user=root --mysql-password=root --mysql-host=192.168.0.226 --max-requests=0 --mysql-db=sbtest run
清理:
sysbench --test=/usr/share/sysbench/oltp_point_select.lua --mysql-user=root --mysql-password=root --mysql-host=192.168.0.226 clean