Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use tpcc-mysql to test the TPCC performance of mysql

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to use tpcc-mysql to test the TPCC performance of mysql. It is very detailed and has a certain reference value. Interested friends must read it!

Tpcc-mysq is a performance testing tool that meets the TPCC specification. The specific steps are as follows:

1. Download

Download the installation package from https://github.com/Percona-Lab/tpcc-mysql.

2. Installation

[root@D2-LZY245 ~] # unzip tpcc-mysql-master.zip

[root@D2-LZY245 ~] # cd tpcc-mysql-master/src/

[root@D2-LZY245 src] # make

[root@D2-LZY245 ~] # ll tpcc-mysql-master/tpcc_*

-rwxrwxr-x 1 root root 81114 May 19 15:12 tpcc-mysql-master/tpcc_load

-rwxrwxr-x 1 root root 188582 May 19 15:13 tpcc-mysql-master/tpcc_start

When the compilation is complete, you have two scripts, tpcc_load and tpcc_start. Tpcc_load is used to initialize data, and tpcc_start is used to perform benchmarking.

3. Load

[root@D2-LZY245] # mysqladmin-uroot-p123456 create tpcc

[root@D2-LZY245] # mysql-uroot-p123456 tpcc

< /root/tpcc-mysql-master/create_table.sql [root@D2-LZY245 ~]# mysql -uroot -p123456 tpcc < /root/tpcc-mysql-master/add_fkey_idx.sql [root@D2-LZY245 ~]# cd /root/tpcc-mysql-master/ [root@D2-LZY245 tpcc-mysql-master]# ./tpcc_load -h227.0.0.1 -dtpcc -uroot -p123456 -w5 其中w表示仓库的数量,数量越多,数据量也越大,这里只初始化了5个仓库。在生产环境中建议设置至少100以上。 如果提示找不到libmysqlclient.so.20,则需要创建下面的软连接: [root@D2-LZY245 ~]# ln -s /usr/local/mysql/lib/libmysqlclient.so.20 /usr/lib64/libmysqlclient.so.20 4、测试 配置如下参数: max_connections=3000 innodb_buffer_pool_size=1G innodb_flush_log_at_trx_commit = 1 sync_binlog=1 innodb_support_xa=1 开始测试: [root@D2-LZY245 tpcc-mysql-master]# ./tpcc_start -h227.0.0.1 -P3306 -dtpcc -uroot -p123456 -w5 -c10 -r10 -l60 -i5 *************************************** *** ###easy### TPC-C Load Generator *** *************************************** option h with value '127.0.0.1' option P with value '3306' option d with value 'tpcc' option u with value 'root' option p with value '123456' option w with value '5' option c with value '10' option r with value '10' option l with value '60' option i with value '5' [server]: 127.0.0.1 [port]: 3306 [DBname]: tpcc [user]: root [pass]: 123456 [warehouse]: 5 [connection]: 10 [rampup]: 10 (sec.) [measure]: 60 (sec.) RAMP-UP TIME.(10 sec.) MEASURING START. 5, trx: 893, 95%: 42.974, 99%: 51.769, max_rt: 78.867, 897|64.315, 89|34.091, 90|108.740, 89|153.851 10, trx: 899, 95%: 42.513, 99%: 47.764, max_rt: 56.527, 897|45.126, 90|11.137, 90|107.048, 90|151.175 15, trx: 921, 95%: 41.732, 99%: 48.921, max_rt: 74.593, 919|61.086, 93|11.268, 91|122.762, 91|117.930 20, trx: 905, 95%: 42.184, 99%: 47.308, max_rt: 72.272, 906|38.270, 90|10.840, 92|126.833, 91|138.162 25, trx: 918, 95%: 42.260, 99%: 51.183, max_rt: 66.282, 914|39.754, 92|10.141, 91|126.593, 91|127.785 30, trx: 934, 95%: 42.285, 99%: 50.212, max_rt: 56.423, 939|37.721, 93|12.561, 93|114.696, 94|133.147 35, trx: 948, 95%: 41.532, 99%: 49.808, max_rt: 59.926, 945|35.327, 95|6.179, 95|104.323, 95|125.155 40, trx: 949, 95%: 40.562, 99%: 46.411, max_rt: 65.310, 950|49.201, 95|7.696, 96|117.888, 94|131.387 45, trx: 953, 95%: 40.067, 99%: 46.689, max_rt: 61.701, 955|50.164, 95|5.216, 95|110.307, 96|118.410 50, trx: 953, 95%: 40.537, 99%: 47.864, max_rt: 87.589, 950|48.743, 95|6.670, 95|118.108, 95|138.823 55, trx: 947, 95%: 39.995, 99%: 46.203, max_rt: 62.354, 948|41.478, 95|6.599, 94|114.913, 95|132.025 60, trx: 986, 95%: 40.477, 99%: 45.516, max_rt: 59.243, 982|37.025, 98|8.749, 99|105.574, 99|127.634 STOPPING THREADS.......... [0] sc:44 lt:11162 rt:0 fl:0 avg_rt: 32.3 (5) [1] sc:1734 lt:9468 rt:0 fl:0 avg_rt: 9.3 (5) [2] sc:1063 lt:57 rt:0 fl:0 avg_rt: 3.3 (5) [3] sc:690 lt:431 rt:0 fl:0 avg_rt: 90.5 (80) [4] sc:0 lt:1120 rt:0 fl:0 avg_rt: 114.3 (20) in 60 sec. [0] sc:44 lt:11162 rt:0 fl:0 [1] sc:1734 lt:9469 rt:0 fl:0 [2] sc:1063 lt:57 rt:0 fl:0 [3] sc:690 lt:431 rt:0 fl:0 [4] sc:0 lt:1120 rt:0 fl:0 (all must be [OK]) [transaction percentage] Payment: 43.47% (>

= 43.0%) [OK]

Order-Status: 4.35% (> = 4.0%) [OK]

Delivery: 4.35% (> = 4.0%) [OK]

Stock-Level: 4.35% (> = 4.0%) [OK]

[response time (at least 90% passed)]

New-Order: 0.39% [NG] *

Payment: 15.48% [NG] *

Order-Status: 94.91% [OK]

Delivery: 61.55% [NG] *

Stock-Level: 0.005% [NG] *

11206.000 TpmC

Where:

-w: number of warehouses

-c: number of concurrent threads

-r: warm-up time in seconds. Default is 10 seconds. The main purpose is to load data into memory.

-l: run time, in seconds. Default is 20 seconds.

-I: output interval

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

5. Results

5, trx: 893,95%: 42.974, 99%: 51.769, max_rt: 78.867, 897 | 64.315, 89 | 34.091, 90 | 108.740, 89 | 153.851

5 means that the time from the start of the test to the present is 5 seconds.

Trx: 893 indicates that the number of new orders completed during this interval is actually the throughput, and the larger the better.

95%: 42.974 means that the response time for 95% of new orders during this interval is 42.974 seconds.

99%: 51.769 means that the response time for 99% of new orders during this interval is 51.769 seconds.

Max_rt: 78.867 indicates that the maximum response time for new order transactions during this interval is 78.867 seconds.

64.315 | 64.315, 89 | 34.091, 90 | 108.740, 89 | 153.851 indicates the throughput and response time of other kinds of things, which can be ignored.

[0] sc:44 lt:11162 rt:0 fl:0 avg_rt: 32.3 (5) / / indicates the number of new order business successes (success, sc), late (lt), retry (rt), and failure (fl).

[1] sc:1734 lt:9468 rt:0 fl:0 avg_rt: 9.3 (5) / / indicates the number of success (sc), late (lt), retry (rt) and failure (fl) of payment business.

[2] sc:1063 lt:57 rt:0 fl:0 avg_rt: 3. 3 (5) / / indicates the number of order status business success (success, sc), delay (late, lt), retry (rt), and failure (failure, fl).

[3] sc:690 lt:431 rt:0 fl:0 avg_rt: 90.5 (80) / / indicates the number of success (sc), late (lt), retry (rt) and failure (fl) of the shipping business.

[4] sc:0 lt:1120 rt:0 fl:0 avg_rt: 114.3 (20) / / indicates the number of success (sc), late (lt), retry (rt) and failure (fl) of inventory business.

(all must be [OK]) / / all the following results must be OK

[transaction percentage]

Payment: 43.47% (> = 43.0%) [OK] / / payment module accounts for 43.47% of total business

Order-Status: 4.35% (> = 4.0%) [OK] / / order status module accounts for 4.35% of total business

Delivery: 4.35% (> = 4.0%) [OK] / / Shipping module accounts for 4.35% of total business

Stock-Level: 4.35% (> = 4.0%) [OK] / / inventory module accounts for 4.35% of total business

[response time (at least 90% passed)] / / whether the response time is satisfied

New-Order: 0.39% [NG] *

Payment: 15.48% [NG] *

Order-Status: 94.91% [OK]

Delivery: 61.55% [NG] *

Stock-Level: 0.005% [NG] *

The indicators are as follows:

New-Order 5ms

Payment 5ms

Order-Status 5ms

Delivery 80ms

Stock-Level 20ms

11206.000 TpmC / / number of new orders that can be processed per minute.

The above is all the content of the article "how to use tpcc-mysql to test the TPCC performance of mysql". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report