tpcc-mysql pressure test Mysql

background

新库新主机上线基准测试

Write in front

做以下操作之前,请自行优化系统OS参数和mysql参数,也可以复制一份线上的文件对比更改下

Reason for writing this article
sysbench 工具使用者比较广泛,偶然在网上看到tpcc-mysql+gnuplot生成测试图片的文章,所以进行了以下测试。 需要注意的是新的版本生成的数据和文章的数据不一样。我在文末附上文章链接,本文没有进行图片的生成工作。 请读者进行区分。

1. Installation tools

unzip tpcc-mysql-master.zip 
cd tpcc-mysql-master/src
make

安装完成之后,根据自己的环境更改以下语句进行基测
准备工作: 
1.# 创建测试用的数据库
create database tpcc 

2.# 创建测试用的表 9张
/usr/local/sandboxes/mysql_base/5.7.26/bin/mysql -hlocalhost -port17261 --socket=/tmp/mysql_sandbox17261.sock -umsandbox -p tpcc <create_table.sql

3.#创建FK和索引
/usr/local/sandboxes/mysql_base/5.7.26/bin/mysql -hlocalhost -port17261 --socket=/tmp/mysql_sandbox17261.sock -umsandbox -p tpcc <add_fkey_idx.sql

./tpcc_load --help
Usage: tpcc_load -h server_host -P port -d database_name -u mysql_user -p mysql_password -w warehouses -l part -m min_wh -n max_wh
* [part]: 1=ITEMS 2=WAREHOUSE 3=CUSTOMER 4=ORDERS

4.创建五个数据仓库:
./tpcc_load -h localhost -P 17261 -d tpcc -u msandbox -p123456 -w 5

5.进行压测:
./tpcc_start --help
Usage: tpcc_start -h server_host -P port -d database_name -u mysql_user -p mysql_password -w warehouses -c connections -r warmup_time -l running_time -i report_interval -f report_file -t trx_file

# ./tpcc_start -h localhost -d tpcc -u msandbox -p "123456" -w 5 -c 5 -r 120 -l 5 - >test0118/tpcc-output-log
-w 5 使用仓库数
-c 5 使用5个线程
-r 120 使用预热120s
-l 300 运行基准测试的时间300s

下载地址https://github.com/Percona-Lab/tpcc-mysql
link

Note:
tpcc will read the socket location /var/lib/mysql/mysql.sock by default. If the mysql socket of your test environment is not in the corresponding path, you need to make a soft connection, or connect to test through TCP/IP server.
ln -s /tmp/mysql_sandbox17261.sock /tmp/mysql.sock

Official interpretation of the output

输出量
使用定义的间隔(-i选项),该工具将产生以下输出:

  10, trx: 12920, 95%: 9.483, 99%: 18.738, max_rt: 213.169, 12919|98.778, 1292|101.096, 1293|443.955, 1293|670.842
  20, trx: 12666, 95%: 7.074, 99%: 15.578, max_rt: 53.733, 12668|50.420, 1267|35.846, 1266|58.292, 1267|37.421
  30, trx: 13269, 95%: 6.806, 99%: 13.126, max_rt: 41.425, 13267|27.968, 1327|32.242, 1327|40.529, 1327|29.580
  40, trx: 12721, 95%: 7.265, 99%: 15.223, max_rt: 60.368, 12721|42.837, 1271|34.567, 1272|64.284, 1272|22.947
  50, trx: 12573, 95%: 7.185, 99%: 14.624, max_rt: 48.607, 12573|45.345, 1258|41.104, 1258|54.022, 1257|26.626
哪里:

10-基准测试开始后的秒数
trx:12920-在给定间隔内执行新订单交易(在这种情况下,为前10秒)。基本上,这是每个时间间隔的吞吐量。越多越好
95%:9.483:-每个给定间隔的新订单交易的95%响应时间。在这种情况下是9.483秒
99%:18.738:-每个给定间隔的新订单交易的99%响应时间。在这种情况下为18.738秒
max_rt:213.169:-每个给定间隔的新订单交易的最大响应时间。在这种情况下为213.169秒
其余:12919|98.778, 1292|101.096, 1293|443.955, 1293|670.842是其他类型事务的吞吐量和最大响应时间,可以忽略

Advice from Mr. Ye from Zhishutang

In the real test scenario, the number of warehouses is generally not recommended to be less than 100, depending on the server hardware configuration. If it is equipped with a high IOPS device such as SSD or PCIE SSD, it is recommended to at least not be less than 1000.

In a real test scenario, it is recommended that the warm-up time is not less than 5 minutes, and the duration of the continuous pressure test is not less than 30 minutes, otherwise the test data may not be of reference significance.

a. The filled test data is larger than the physical memory, at least exceeding the value of innodb_buffer_pool_size. You cannot load all the data into the memory, unless your intention is to test the MySQL performance in the full memory state.

b. After each round of testing is completed, restart the mysqld instance, and use the following method to delete the system cache, release swap (if swap is used), and even restart the entire OS.
sync-flush dirty data to disk
echo 3> /proc/sys/vm/drop_cache-clear OS Cache
swapoff -a && swapon -a

link

参考文章
link
格式不同之处:
Insert picture description here
勉强能看的内容:
Insert picture description here
This article explains that the main technical content comes from the sharing of Internet technology giants, as well as some self-processing (only for the role of annotations). If related questions, please leave a message after the confirmation, the implementation of infringement will be deleted

Guess you like

Origin blog.csdn.net/baidu_34007305/article/details/112841456