TiDB TPC-C 性能对比测试报告 - v5.0 对比 v4.0
测试目的
测试对比 TiDB v5.0 和 v4.0 OLTP 场景下的性能。
测试环境 (AWS EC2)
硬件配置
| 服务类型 | EC2 类型 | 实例数 |
|---|---|---|
| PD | m5.xlarge | 3 |
| TiKV | i3.4xlarge | 3 |
| TiDB | c5.4xlarge | 3 |
| TPC-C | c5.9xlarge | 1 |
软件版本
| 服务类型 | 软件版本 |
|---|---|
| PD | 4.0、5.0 |
| TiDB | 4.0、5.0 |
| TiKV | 4.0、5.0 |
| BenchmarkSQL | 无 |
配置参数
TiDB v4.0 参数配置
1. log.level: "error"
2. performance.max-procs: 20
3. prepared-plan-cache.enabled: true
4. tikv-client.max-batch-wait-time: 2000000
TiKV v4.0 参数配置
1. pessimistic-txn.pipelined: true
2. raftdb.allow-concurrent-memtable-write: true
3. raftdb.max-background-jobs: 4
4. raftstore.apply-max-batch-size: 2048
5. raftstore.apply-pool-size: 3
6. raftstore.store-max-batch-size: 2048
7. raftstore.store-pool-size: 3
8. readpool.storage.normal-concurrency: 10
9. readpool.unified.max-thread-count: 20
10. readpool.unified.min-thread-count: 5
11. rocksdb.max-background-jobs: 8
12. server.grpc-concurrency: 6
13. server.request-batch-enable-cross-command: false
14. storage.scheduler-worker-pool-size: 20
TiDB v5.0 参数配置
1. log.level: "error"
2. performance.max-procs: 20
3. prepared-plan-cache.enabled: true
4. tikv-client.max-batch-wait-time: 2000000
TiKV v5.0 参数配置
1. pessimistic-txn.pipelined: true
2. raftdb.allow-concurrent-memtable-write: true
3. raftdb.max-background-jobs: 4
4. raftstore.apply-max-batch-size: 2048
5. raftstore.apply-pool-size: 3
6. raftstore.store-max-batch-size: 2048
7. raftstore.store-pool-size: 3
8. readpool.storage.normal-concurrency: 10
9. readpool.unified.max-thread-count: 20
10. readpool.unified.min-thread-count: 5
11. rocksdb.max-background-jobs: 8
12. server.grpc-concurrency: 6
13. storage.scheduler-worker-pool-size: 20
14. server.enable-request-batch: false
TiDB v4.0 全局变量配置
1. set global tidb_hashagg_final_concurrency=1;
2. set global tidb_hashagg_partial_concurrency=1;
TiDB v5.0 全局变量配置
1. set global tidb_hashagg_final_concurrency=1;
2. set global tidb_hashagg_partial_concurrency=1;
3. set global tidb_enable_async_commit = 1;
4. set global tidb_enable_1pc = 1;
5. set global tidb_guarantee_linearizability = 0;
6. set global tidb_enable_clustered_index = 1;
测试方案
- 通过 TiUP 部署 TiDB v5.0 和 v4.0。
-
通过 BenchmarkSQL 导入 TPC-C 5000 Warehouse 数据。
-
编译 BenchmarkSQL:
1. git clone https://github.com/pingcap/benchmarksql && cd benchmarksql && ant2. 进入run目录,根据实际情况编辑props.mysql文件,调整conn、warehouses、loadWorkers、terminals、runMins配置项。 3. 运行runSQL.sh ./props.mysql sql.mysql/tableCreates.sql命令。 4. 运行runSQL.sh ./props.mysql sql.mysql/indexCreates.sql命令。 5. 运行 MySQL client 并对每个表执行analyze table语句。 3. 运行runBenchmark.sh ./props.mysql命令。 4. 从结果中提取 New Order 的 tpmC 的数据。
测试结果
v5.0 比 v4.0 在 TPC-C 性能上提升了 36%。

