TiDB TPC-C パフォーマンス テスト レポート -- v5.0 対 v4.0
テストの目的
このテストは、オンライン トランザクション処理 (OLTP) シナリオで TiDB v5.0 と TiDB v4.0 の TPC-C パフォーマンスを比較することを目的としています。
テスト環境(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 |
ベンチマークSQL | なし |
パラメータ構成
TiDB v4.0 構成
log.level: "error"
performance.max-procs: 20
prepared-plan-cache.enabled: true
tikv-client.max-batch-wait-time: 2000000
TiKV v4.0 構成
pessimistic-txn.pipelined: true
raftdb.allow-concurrent-memtable-write: true
raftdb.max-background-jobs: 4
raftstore.apply-max-batch-size: 2048
raftstore.apply-pool-size: 3
raftstore.store-max-batch-size: 2048
raftstore.store-pool-size: 3
readpool.storage.normal-concurrency: 10
readpool.unified.max-thread-count: 20
readpool.unified.min-thread-count: 5
rocksdb.max-background-jobs: 8
server.grpc-concurrency: 6
server.request-batch-enable-cross-command: false
storage.scheduler-worker-pool-size: 20
TiDB v5.0 構成
log.level: "error"
performance.max-procs: 20
prepared-plan-cache.enabled: true
tikv-client.max-batch-wait-time: 2000000
TiKV v5.0 構成
pessimistic-txn.pipelined: true
raftdb.allow-concurrent-memtable-write: true
raftdb.max-background-jobs: 4
raftstore.apply-max-batch-size: 2048
raftstore.apply-pool-size: 3
raftstore.store-max-batch-size: 2048
raftstore.store-pool-size: 3
readpool.storage.normal-concurrency: 10
readpool.unified.max-thread-count: 20
readpool.unified.min-thread-count: 5
rocksdb.max-background-jobs: 8
server.grpc-concurrency: 6
storage.scheduler-worker-pool-size: 20
server.enable-request-batch: false
TiDB v4.0 グローバル変数の構成
set global tidb_hashagg_final_concurrency=1;
set global tidb_hashagg_partial_concurrency=1;
TiDB v5.0 グローバル変数の構成
set global tidb_hashagg_final_concurrency=1;
set global tidb_hashagg_partial_concurrency=1;
set global tidb_enable_async_commit = 1;
set global tidb_enable_1pc = 1;
set global tidb_guarantee_linearizability = 0;
set global tidb_enable_clustered_index = 1;
テスト計画
TiUP を使用して TiDB v5.0 および v4.0 をデプロイします。
BenchmarkSQL を使用して、TPC-C 5000 Warehouse データをインポートします。
- BenchmarkSQL をコンパイルします。
```bash
git clone https://github.com/pingcap/benchmarksql && cd benchmarksql && ant
```
2. `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 クライアントを実行し、すべてのテーブルで`analyze table`のステートメントを実行します。
runBenchmark.sh ./props.mysql
コマンドを実行します。結果から New Order の tpmC データを抽出します。
テスト結果
テスト統計によると、TiDB v5.0 の TPC-C パフォーマンスは、TiDB v4.0 と比較して36% 向上しています。