You need to enable JavaScript to run this app.
导航

测试方法

最近更新时间2022.11.25 21:46:18

首次发布时间2022.06.24 15:51:08

本文介绍云数据库 MySQL 版性能测试所使用的测试方法。

测试步骤

请根据实际信息,替换数据库、连接 IP 与用户密码。

1.导入数据

nohup sysbench --test=/usr/local/share/sysbench/tests/include/oltp_legacy/oltp.lua --db-driver=mysql --mysql-db=XXX --mysql-user=XXX --mysql-password=XXX --mysql-port=XXX --mysql-host=XXX --oltp-tables-count=64 --oltp-table-size=10000000 --num-threads=20 prepare

2.压测数据

sysbench /usr/local/share/sysbench/tests/include/oltp_legacy/oltp.lua --db-driver=mysql --mysql-db=XXX --mysql-user=XXX --mysql-password=XXX --mysql-port=3306 --mysql-host=XXX --oltp-tables-count=64 --oltp-table-size=10000000 --time=600 --max-requests=0 --threads=32 --report-interval=3 --forced-shutdown=1 run

3.清理数据

sysbench --test=/usr/local/share/sysbench/tests/include/oltp_legacy/oltp.lua --db-driver=mysql --mysql-db=XXX --mysql-user=XXX --mysql-password=XXX --mysql-port=3306 --mysql-host=XXX --oltp-tables-count=64 --oltp-table-size=10000000 --max-time=3600 --max-requests=0 --num-threads=32 cleanup