diff --git a/TOC-tidb-cloud.md b/TOC-tidb-cloud.md index e68c129f8cf9f..1a9837f9bd4ce 100644 --- a/TOC-tidb-cloud.md +++ b/TOC-tidb-cloud.md @@ -262,6 +262,8 @@ - [Dedicated Tier Limitations and Quotas](/tidb-cloud/limitations-and-quotas.md) - [Serverless Tier Limitations](/tidb-cloud/serverless-tier-limitations.md) - [TiDB Limitations](/tidb-limitations.md) + - Benchmarks + - [TPC-C Performance Test Report](/tidb-cloud/v7.1.0-performance-benchmarking-with-tpcc.md) - SQL - [Explore SQL with TiDB](/basic-sql-operations.md) - SQL Language Structure and Syntax diff --git a/media/tidb-cloud/v7.1.0-tpmC.png b/media/tidb-cloud/v7.1.0-tpmC.png new file mode 100644 index 0000000000000..fbb290da44507 Binary files /dev/null and b/media/tidb-cloud/v7.1.0-tpmC.png differ diff --git a/tidb-cloud/v7.1.0-performance-benchmarking-with-tpcc.md b/tidb-cloud/v7.1.0-performance-benchmarking-with-tpcc.md new file mode 100644 index 0000000000000..3ba971bd4a813 --- /dev/null +++ b/tidb-cloud/v7.1.0-performance-benchmarking-with-tpcc.md @@ -0,0 +1,111 @@ +--- +title: TiDB Cloud TPC-C Performance Test Report +summary: Introduce the TPC-C performance test results for TiDB Cloud. +--- + +# TiDB Cloud TPC-C Performance Test Report + +This document provides the TPC-C performance test steps and results for a TiDB Dedicated cluster with the TiDB version of v7.1.0. This report can also be used as a reference for the performance of TiDB v7.1.0 clusters. + +## Test overview + +This test aims at showing the TPC-C performance of TiDB v7.1.0 in the Online Transactional Processing (OLTP) scenario. + +## Test environment + +### TiDB cluster + +The test is conducted on a TiDB cluster with the following settings: + +- Cluster type: [Dedicated Tier](/tidb-cloud/select-cluster-tier.md#dedicated-tier) +- Cluster version: v7.1.0 +- Cloud provider: AWS (us-west-2) +- Cluster configuration: + + | Node type | Node size | Node quantity | Node storage | + |:----------|:----------|:----------|:----------| + | TiDB | 16 vCPU, 32 GiB | 2 | N/A | + | TiKV | 16 vCPU, 64 GiB | 3 | 1000 GiB | + +### Benchmark executor + +The benchmark executor sends SQL queries to the TiDB cluster. In this test, its hardware configuration is as follows: + +- Machine type: Amazon EC2 (us-west-2) +- Instance type: c6a.2xlarge + +## Test steps + +This section introduces how to perform the TPC-C performance test step by step. + +1. In the [TiDB Cloud console](https://tidbcloud.com/), create a TiDB Dedicated cluster that meets the [test environment](#tidb-cluster) requirements. + + For more information, see [Create a TiDB cluster](/tidb-cloud/create-tidb-cluster.md). + +2. On the benchmark executor, connect to the newly created cluster and create a database named `tpcc`. + + To connect to the cluster, see [Connect via Private Endpoint](/tidb-cloud/set-up-private-endpoint-connections.md). + + To create the `tpcc` database, execute the following SQL statement: + + ```sql + CREATE DATABASE tpcc; + ``` + +3. Load TPC-C data to the `tpcc` database. + + 1. The test in this document is implemented based on [go-tpc](https://github.com/pingcap/go-tpc). You can download the test program using the following command: + + ```shell + curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/pingcap/go-tpc/master/install.sh | sh + ``` + + 2. Run the following `go-tpc tpcc` command to import 1,000 warehouses to the `tpcc` database. Replace `${HOST}`, `${THREAD}`, and `${PASSWORD}` with your actual values. This document conducts three tests with the `${THREAD}` value of `50`, `100`, and `200`. + + ```shell + go-tpc tpcc --host ${HOST} --warehouses 1000 prepare -P 4000 -D tpcc -T ${THREAD} --time 2h0m0s -p ${PASSWORD} --ignore-error + ``` + +4. To ensure that the TiDB optimizer can generate the optimal execution plan, execute the following SQL statements to collect statistics before conducting the TPC-C test: + + ```sql + ANALYZE TABLE customer; + ANALYZE TABLE district; + ANALYZE TABLE history; + ANALYZE TABLE item; + ANALYZE TABLE new_order; + ANALYZE TABLE order_line; + ANALYZE TABLE orders; + ANALYZE TABLE stock; + ANALYZE TABLE warehouse; + ``` + + To accelerate the collection of statistics, execute the following SQL statements before collecting: + + ```sql + SET tidb_build_stats_concurrency=16; + SET tidb_distsql_scan_concurrency=16; + SET tidb_index_serial_scan_concurrency=16; + ``` + +5. Run the following `go-tpc tpcc` command to conduct stress tests on the TiDB Dedicated cluster. For each concurrency, the test takes two hours. + + ```shell + go-tpc tpcc --host ${HOST} -P 4000 --warehouses 1000 run -D tpcc -T ${THREAD} --time 2h0m0s -p ${PASSWORD} --ignore-error + ``` + +6. Extract the tpmC data of `NEW_ORDER` from the result. + + TPC-C uses tpmC (transactions per minute) to measure the maximum qualified throughput (MQTh, Max Qualified Throughput). The transactions are the NewOrder transactions and the final unit of measure is the number of new orders processed per minute. + +## Test results + +The TPC-C performance of v7.1.0 in the [test environment](#test-environment) is as follows: + +| Threads | v7.1.0 tpmC | +|:--------|:----------| +| 50 | 36,159 | +| 100 | 66,742 | +| 200 | 94,406 | + +![TPC-C](/media/tidb-cloud/v7.1.0-tpmC.png)