TiDB TPC-C 性能对比测试报告 - v5.2.0 对比 v5.1.1

测试概况

本次测试对比了 TiDB v5.2.0 和 v5.1.1 在 OLTP 场景下的 TPC-C 性能表现。结果显示,v5.2.0 相比于 v5.1.1 在 TPC-C 性能上下降了 4.22%。

测试环境 (AWS EC2)

硬件配置

服务类型 EC2 类型 实例数
PD m5.xlarge 3
TiKV i3.4xlarge 3
TiDB c5.4xlarge 3
TPC-C c5.9xlarge 1

软件版本

服务类型 软件版本
PD v5.1.1、v5.2.0
TiDB v5.1.1、v5.2.0
TiKV v5.1.1、v5.2.0
TiUP 1.5.1

配置参数

两个版本使用同样的配置

TiDB 参数配置

1. log.level: "error"
2. performance.max-procs: 20
3. prepared-plan-cache.enabled: true
4. tikv-client.max-batch-wait-time: 2000000

TiKV 参数配置

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 全局变量配置

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;

测试方案

  1. 通过 TiUP 部署 TiDB v5.2.0 和 v5.1.1。
  2. 创建数据库 tpcc:create database tpcc;
  3. 通过 tiup bench 导入 TPC-C 5000 Warehouse 数据:tiup bench tpcc prepare --warehouses 5000 --db tpcc -H 127.0.0.1 -p 4000。
  4. 运行 tiup bench tpcc run -U root --db tpcc --host 127.0.0.1 --port 4000 --time 300s --warehouses 5000 --threads {{thread}} 命令,通过 HAProxy 向 TiDB 加压。
  5. 从结果中提取 New Order 的 tpmC 的数据。

测试结果

v5.2.0 相比 v5.1.1 在 TPC-C 性能上下降了 4.22%。

TPC-C