当前位置:网站首页>How to conduct TPC-C test on tidb
How to conduct TPC-C test on tidb
2022-07-02 15:08:00 【Tianxiang shop】
This article introduces how to TiDB Conduct TPC-C test .
TPC-C It's a right OLTP( Online transaction processing ) Specification for system testing , Use a commodity sales model to OLTP The system is tested , There are five types of transactions :
- NewOrder – Generation of new orders
- Payment – Order payment
- OrderStatus – Recent order query
- Delivery – Delivery
- StockLevel – Inventory shortage status analysis
Before the test begins ,TPC-C Benchmark Specifies the initial state of the database , That is, the rules of data generation in the database , among ITEM The table contains 10 Ten thousand kinds of goods , The number of warehouses can be adjusted , hypothesis WAREHOUSE Table has W Bar record , that :
- STOCK There should be... In the table W * 10 Ten thousand records ( Each warehouse corresponds to 10 Inventory data of 10000 Commodities )
- DISTRICT There should be... In the table W * 10 Bar record ( Each warehouse is 10 Provide services in three regions )
- CUSTOMER There should be... In the table W * 10 * 3000 Bar record ( Each region has 3000 A customer )
- HISTORY There should be... In the table W * 10 * 3000 Bar record ( Each customer has a transaction history )
- ORDER There should be... In the table W * 10 * 3000 Bar record ( Every region 3000 Order per order ), And finally generated 900 Orders were added to NEW-ORDER In the table , Each order is randomly generated 5 ~ 15 strip ORDER-LINE Record .
We're going to 1000 WAREHOUSE Test for an example .
TPC-C Use tpmC value (Transactions per Minute) To measure the maximum effective throughput of the system (MQTh, Max Qualified Throughput), among Transactions With NewOrder Transaction Subject to , That is, the final measurement unit is the number of new orders processed per minute .
This article USES the go-tpc As TPC-C Test implementation , Can pass TiUP Command to download the test program :
tiup install bench
About TiUP Bench For detailed usage of components, please refer to TiUP Bench.
Import data
Importing data is usually the whole TPC-C The most time-consuming test , It is also the most problematic stage .
stay shell Run in TiUP command :
tiup bench tpcc -H 172.16.5.140 -P 4000 -D tpcc --warehouses 1000 prepare
Based on different machine configurations , This process may last for several hours . If it is a small cluster , You can use smaller WAREHOUSE Value to test .
When the data import is complete , By command tiup bench tpcc -H 172.16.5.140 -P 4000 -D tpcc --warehouses 4 check
Verify data correctness .
Run the test
The command to run the test is :
tiup bench tpcc -H 172.16.5.140 -P 4000 -D tpcc --warehouses 1000 run
Test results will be continuously printed on the console during operation :
[Current] NEW_ORDER - Takes(s): 4.6, Count: 5, TPM: 65.5, Sum(ms): 4604, Avg(ms): 920, 90th(ms): 1500, 99th(ms): 1500, 99.9th(ms): 1500 [Current] ORDER_STATUS - Takes(s): 1.4, Count: 1, TPM: 42.2, Sum(ms): 256, Avg(ms): 256, 90th(ms): 256, 99th(ms): 256, 99.9th(ms): 256 [Current] PAYMENT - Takes(s): 6.9, Count: 5, TPM: 43.7, Sum(ms): 2208, Avg(ms): 441, 90th(ms): 512, 99th(ms): 512, 99.9th(ms): 512 [Current] STOCK_LEVEL - Takes(s): 4.4, Count: 1, TPM: 13.8, Sum(ms): 224, Avg(ms): 224, 90th(ms): 256, 99th(ms): 256, 99.9th(ms): 256 ...
At the end of the run , Will print test statistical results :
[Summary] DELIVERY - Takes(s): 455.2, Count: 32, TPM: 4.2, Sum(ms): 44376, Avg(ms): 1386, 90th(ms): 2000, 99th(ms): 4000, 99.9th(ms): 4000 [Summary] DELIVERY_ERR - Takes(s): 455.2, Count: 1, TPM: 0.1, Sum(ms): 953, Avg(ms): 953, 90th(ms): 1000, 99th(ms): 1000, 99.9th(ms): 1000 [Summary] NEW_ORDER - Takes(s): 487.8, Count: 314, TPM: 38.6, Sum(ms): 282377, Avg(ms): 899, 90th(ms): 1500, 99th(ms): 1500, 99.9th(ms): 1500 [Summary] ORDER_STATUS - Takes(s): 484.6, Count: 29, TPM: 3.6, Sum(ms): 8423, Avg(ms): 290, 90th(ms): 512, 99th(ms): 1500, 99.9th(ms): 1500 [Summary] PAYMENT - Takes(s): 490.1, Count: 321, TPM: 39.3, Sum(ms): 144708, Avg(ms): 450, 90th(ms): 512, 99th(ms): 1000, 99.9th(ms): 1500 [Summary] STOCK_LEVEL - Takes(s): 487.6, Count: 41, TPM: 5.0, Sum(ms): 9318, Avg(ms): 227, 90th(ms): 512, 99th(ms): 1000, 99.9th(ms): 1000
Once the test is complete , It can also run tiup bench tpcc -H 172.16.5.140 -P 4000 -D tpcc --warehouses 4 check
Verify the correctness of data .
Clean up the test data
tiup bench tpcc -H 172.16.5.140 -P 4000 -D tpcc --warehouses 4 cleanup
边栏推荐
- 07_哈希
- LeetCode 2320. Count the number of ways to place the house
- 05_队列
- IE 浏览器正式退休
- 使用mathtype编辑公式,复制粘贴时设置成仅包含mathjax语法的公式
- LeetCode - 搜索二维矩阵
- Reuse and distribution
- Obsidian installs third-party plug-ins - unable to load plug-ins
- [development environment] install the visual studio community 2013 development environment (download the installation package of visual studio community 2013 with update 5 version)
- Mavn 搭建 Nexus 私服
猜你喜欢
随机推荐
Reuse and distribution
info [email protected] : The platform “win32“ is incompatible with this module.
C语言中的printf函数和scanf函数
LeetCode 2310. 个位数字为 K 的整数之和
.NET Core 日志系统
taobao. trade. memo. Add (add remarks to a transaction) interface, Taobao store flag insertion interface, Taobao order flag insertion API interface, oauth2.0 interface
Obsidian installs third-party plug-ins - unable to load plug-ins
HUSTPC2022
TiDB跨数据中心部署拓扑
The past and present lives of visual page building tools
Introduction to C language -- array
[QNX hypervisor 2.2 user manual]6.3 communication between guest and external
Find the maximum inscribed circle of the contour
taobao. trades. sold. Get query the transaction data that the seller has sold (according to the creation time), Taobao store sales order query API interface, Taobao R2 interface, Taobao oauth2.0 trans
Full of knowledge points, how to use JMeter to generate encrypted data and write it to the database? Don't collect it quickly
使用 TiUP 部署 TiDB 集群
SQL 后计算的利器 SPL
C语言中的算术运算及相关练习题
Wechat applet uses towxml to display formula
关于网页中的文本选择以及统计选中文本长度