Run a TPC-C benchmark against PolarDB-X 1.0 to measure its online transaction processing (OLTP) throughput in transactions-per-minute-C (tpmC).
This test is based on the TPC Benchmark C (TPC-C) specification but does not satisfy all of its requirements. The results cannot be compared against officially published TPC-C benchmark results.
Background
TPC-C is the industry-standard benchmark for OLTP performance, maintained by the Transaction Processing Performance Council (TPC). It models a wholesale supplier workload across 10 tables and five transaction types:
| Transaction | What it does |
|---|---|
| NewOrder | Places a new order |
| Payment | Processes an order payment |
| OrderStatus | Queries the most recent orders |
| Delivery | Dispatches pending orders |
| StockLevel | Checks inventory levels for potential shortages |
Performance is reported as tpmC (transactions-per-minute-C), which counts the number of NewOrder transactions completed per minute under maximum qualified throughput (MQTh).
Test design
Data scale
For regular instances, the test uses 1,000 warehouses:
| Table | Rows |
|---|---|
| bmsql_order_line | 300 million |
| bmsql_stock | 100 million |
| bmsql_customer | 30 million |
| bmsql_history | 30 million |
| bmsql_oorder | 30 million |
The ultra-large instance test scales to 10,000 warehouses to verify PolarDB-X 1.0 horizontal scalability. Three 32-core Elastic Compute Service (ECS) instances serve as stress test machines to avoid the stress test machines becoming a bottleneck.
Instance specifications
| Edition | PolarDB-X 1.0 nodes | ApsaraDB RDS for MySQL 5.7 instances |
|---|---|---|
| Standard | 2 nodes × 8 CPU cores, 32 GB memory | 4 dedicated instances × 4 CPU cores, 32 GB memory |
| Enterprise | 2 nodes × 16 CPU cores, 64 GB memory | 4 dedicated instances × 8 CPU cores, 32 GB memory |
| Ultra-large | 16 nodes × 16 CPU cores, 64 GB memory | 12 dedicated instances × 32 CPU cores, 128 GB memory |
Choose your edition before starting. The test procedure is the same for all editions — only the instance specifications differ.
Prerequisites
Before you begin, ensure that you have:
-
An ECS instance deployed in a virtual private cloud (VPC). Note the VPC name and ID — all subsequent instances must be in the same VPC
-
A PolarDB-X 1.0 instance in the same VPC. See Create a PolarDB-X 1.0 instance
-
A database named
tpccin the PolarDB-X 1.0 instance. See Create a database
Create all ECS and PolarDB-X 1.0 instances in a VPC. Classic network instances of some types may have insufficient resources.
Run the TPC-C test
Step 1: Set up the test tool
This test uses BenchmarkSQL V5.0. BenchmarkSQL does not support the MySQL protocol by default, so a pre-compiled package with MySQL support is provided.
-
Download tpcc.tar.gz to the ECS instance and extract it:
mkdir tpcc tar zxvf tpcc.tar.gz -C tpccThe compiled package includes the following modifications to standard BenchmarkSQL:
File Change src/client/jTPCC.javaAdded MySQL type src/client/jTPCCConnection.javaAdded MySQL syntax support via alias src/LoadData/LoadData.javaDisabled large transaction mechanism during data loading src/LoadData/LoadDataWorker.javaDisabled large transaction mechanism during data loading run/funcs.shAdded MySQL type run/runDatabaseBuild.shRemoved unnecessary phases run/runBenchmark.shTuned default JVM parameters run/runLoader.shTuned default JVM parameters run/sql.common/foreignKeys.sqlCommented out all foreign key creation statements (PolarDB-X 1.0 does not support foreign keys) run/sql.common/indexCreates.sqlCommented out primary key statements; retained two index statements run/sql.common/indexDrops.sqlCommented out all primary key deletion statements run/sql.common/tableCreates.sqlAdded primary keys and shard keys -
Edit
run/props.mysqlwith your connection details and test parameters:Parameter Purpose Notes warehousesNumber of warehouses (data scale) 1,000 for regular; 10,000 for ultra-large loadWorkersConcurrent data loaders Each 100 workers generates approximately 20,000 TPS; set JVM memory in runLoader.shaccordinglyterminalsConcurrent clients during the stress test Set before running the benchmark runMinsTest duration (minutes) Set before running the benchmark // --------- env config --------- // db=mysql driver=com.mysql.jdbc.Driver conn=jdbc:mysql://drdsxxxx:3306/tpcc?useSSL=false&useServerPrepStmts=false&useConfigs=maxPerformance&rewriteBatchedStatements=true user=tpcc password=tpcc // The number of warehouses. warehouses=1000 // The number of concurrent loadWorkers used to import data. // 100 loadWorkers generate approximately 20,000 TPS. // JVM memory for 100 loadWorkers: 4 GB. For 500 loadWorkers: 16 GB (edit runLoader.sh). loadWorkers=100 // The number of concurrent terminals in the stress test. terminals=1000 // Test duration in minutes. runMins=10 // ---------- default config ------- // runTxnsPerTerminal=0 limitTxnsPerMin=0 terminalWarehouseFixed=true // Transaction mix — must sum to 100 newOrderWeight=45 paymentWeight=43 orderStatusWeight=4 deliveryWeight=4 stockLevelWeight=4 resultDirectory=my_result_%tY-%tm-%td_%tH%tM%tSKey parameters to configure:
Step 2: Load test data
Data loading is the most time-consuming and error-prone stage of the entire test — it imports over 500 million rows using 100 concurrent loadWorkers and takes several hours. Run the command with nohup to keep it running if your SSH session disconnects.
cd tpcc/run
nohup ./runDatabaseBuild.sh props.mysql &
Step 3: Run the benchmark
cd tpcc/run
./runBenchmark.sh props.mysql
During the test, BenchmarkSQL logs progress to the console. When the test completes, the output looks like:
08:56:16,844 [Thread-883] INFO jTPCC : Term-00, Measured tpmC (NewOrders) = 104230.88
08:56:16,844 [Thread-883] INFO jTPCC : Term-00, Measured tpmTOTAL = 231664.49
08:56:16,844 [Thread-883] INFO jTPCC : Term-00, Session Start = 2019-09-19 08:54:16
08:56:16,845 [Thread-883] INFO jTPCC : Term-00, Session End = 2019-09-19 08:56:16
08:56:16,845 [Thread-883] INFO jTPCC : Term-00, Transaction Count = 465440
Step 4: Interpret the results
The tpmC (NewOrders) value is the headline result. It counts how many NewOrder transactions PolarDB-X 1.0 processed per minute during the test window.
tpmTOTAL covers all five transaction types. Because only NewOrder transactions count toward tpmC, tpmTOTAL is always higher than tpmC.
Compare your result against the reference values in the Test results section to evaluate performance relative to each edition's specifications.
Step 5: Clean up
cd tpcc/run
./runDatabaseDestroy.sh props.mysql
Test results
| Concurrency | Standard Edition tpmC | Enterprise Edition tpmC | Ultra-large tpmC |
|---|---|---|---|
| 1 terminal × 1,000 concurrent loadWorkers | 65,735.14 | 101,620.8 | — |
| 6 terminals × 1,000 concurrent loadWorkers | — | — | 821,547.97 |