千家信息网

MySQL 测试工具 sysbench

发表于:2025-02-23 作者:千家信息网编辑
千家信息网最后更新 2025年02月23日,1、配置 epel 源安装 sysbenchyum install -y sysbench2、初始化数据sysbench /usr/share/sysbench/tests/include/oltp_
千家信息网最后更新 2025年02月23日MySQL 测试工具 sysbench

1、配置 epel 源安装 sysbench

yum install -y sysbench

2、初始化数据

sysbench /usr/share/sysbench/tests/include/oltp_legacy/oltp.lua \--mysql-host=192.168.1.226 \--mysql-port=3306 \--mysql-user=root \--mysql-password=MySQL5.7 \--oltp-test-mode=complex \--oltp-tables-count=10 \--oltp-table-size=100000 \--threads=10 \--time=120 \--report-interval=10 \--db-driver=mysql prepare

3、执行测试

sysbench /usr/share/sysbench/tests/include/oltp_legacy/oltp.lua \--mysql-host=192.168.1.226 \--mysql-port=3306 \--mysql-user=root \--mysql-password=MySQL5.7 \--oltp-test-mode=complex \--oltp-tables-count=10 \--oltp-table-size=100000 \--threads=10 \--time=120 \--db-driver=mysql \--report-interval=10 run 

4、清理数据

sysbench /usr/share/sysbench/tests/include/oltp_legacy/oltp.lua \--mysql-host=192.168.1.226 \--mysql-port=3306 \--mysql-user=root \--db-driver=mysql \--oltp-tables-count=10 \--mysql-password=MySQL5.7 cleanup

参考文档:https://www.cnblogs.com/kismetv/p/7615738.html

0