|
| 1 | +--- |
| 2 | +title: TiDB Cloud Sysbench Performance Test Report for TiDB v7.5.0 |
| 3 | +summary: Introduce the Sysbench performance test results for a TiDB Dedicated cluster with the TiDB version of v7.5.0. |
| 4 | +--- |
| 5 | + |
| 6 | +# TiDB Cloud Sysbench Performance Test Report for TiDB v7.5.0 |
| 7 | + |
| 8 | +This document provides the Sysbench performance test steps and results for a TiDB Dedicated cluster with the TiDB version of v7.5.0. This report can also be used as a reference for the performance of TiDB Self-Hosted v7.5.0 clusters. |
| 9 | + |
| 10 | +## Test overview |
| 11 | + |
| 12 | +This test aims at showing the Sysbench performance of TiDB v7.5.0 in the Online Transactional Processing (OLTP) scenario. |
| 13 | + |
| 14 | +## Test environment |
| 15 | + |
| 16 | +### TiDB cluster |
| 17 | + |
| 18 | +The test is conducted on a TiDB cluster with the following settings: |
| 19 | + |
| 20 | +- Cluster type: [TiDB Dedicated](/tidb-cloud/select-cluster-tier.md#tidb-dedicated) |
| 21 | +- Cluster version: v7.5.0 |
| 22 | +- Cloud provider: AWS (us-west-2) |
| 23 | +- Cluster configuration: |
| 24 | + |
| 25 | + | Node type | Node size | Node quantity | Node storage | |
| 26 | + |:----------|:----------|:----------|:----------| |
| 27 | + | TiDB | 16 vCPU, 32 GiB | 2 | N/A | |
| 28 | + | TiKV | 16 vCPU, 64 GiB | 3 | 1000 GiB | |
| 29 | + |
| 30 | +### Parameter configuration |
| 31 | + |
| 32 | +> **Note:** |
| 33 | +> |
| 34 | +> For TiDB Cloud, to modify the TiKV parameters of your cluster, you can contact [PingCAP Support](/tidb-cloud/tidb-cloud-support.md) for help. |
| 35 | +
|
| 36 | +The TiKV parameter [`prefill-for-recycle`](https://docs.pingcap.com/tidb/stable/tikv-configuration-file#prefill-for-recycle-new-in-v700) can make log recycling effective immediately after initialization. This document conducts tests based on different workloads with the following `prefill-for-recycle` configuration: |
| 37 | + |
| 38 | +- For the `oltp_point_select` workload, use the default value of the [`prefill-for-recycle`](https://docs.pingcap.com/tidb/stable/tikv-configuration-file#prefill-for-recycle-new-in-v700) parameter: |
| 39 | + |
| 40 | + ```yaml |
| 41 | + raft-engine.prefill-for-recycle = false |
| 42 | + ``` |
| 43 | + |
| 44 | +- For `oltp_insert`, `oltp_read_write` , `oltp_update_index`, and `oltp_update_non_index` workloads, enable the [`prefill-for-recycle`](https://docs.pingcap.com/tidb/stable/tikv-configuration-file#prefill-for-recycle-new-in-v700) parameter: |
| 45 | + |
| 46 | + ```yaml |
| 47 | + raft-engine.prefill-for-recycle = true |
| 48 | + ``` |
| 49 | + |
| 50 | +### Benchmark executor |
| 51 | + |
| 52 | +The benchmark executor sends SQL queries to the TiDB cluster. In this test, its hardware configuration is as follows: |
| 53 | + |
| 54 | +- Machine type: Amazon EC2 (us-west-2) |
| 55 | +- Instance type: c6a.2xlarge |
| 56 | +- Sysbench version: sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2) |
| 57 | + |
| 58 | +## Test steps |
| 59 | + |
| 60 | +This section introduces how to perform the Sysbench performance test step by step. |
| 61 | + |
| 62 | +1. In the [TiDB Cloud console](https://tidbcloud.com/), create a TiDB Dedicated cluster that meets the [test environment](#tidb-cluster) requirements. |
| 63 | + |
| 64 | + For more information, see [Create a TiDB Dedicated cluster](/tidb-cloud/create-tidb-cluster.md). |
| 65 | + |
| 66 | +2. On the benchmark executor, connect to the newly created cluster and create a database named `sbtest`. |
| 67 | + |
| 68 | + To connect to the cluster, see [Connect to TiDB Dedicated via Private Endpoint](/tidb-cloud/set-up-private-endpoint-connections.md). |
| 69 | + |
| 70 | + To create the `sbtest` database, execute the following SQL statement: |
| 71 | + |
| 72 | + ```sql |
| 73 | + CREATE DATABASE sbtest; |
| 74 | + ``` |
| 75 | + |
| 76 | +3. Load Sysbench data to the `sbtest` database. |
| 77 | + |
| 78 | + 1. The test in this document is implemented based on [sysbench](https://github.com/akopytov/sysbench). To install sysbench, see [Building and installing from source](https://github.com/akopytov/sysbench#building-and-installing-from-source). |
| 79 | + |
| 80 | + 2. Run the following `sysbench prepare` command to import 32 tables and 10,000,000 rows to the `sbtest` database. Replace `${HOST}`, `${PORT}`, `${THREAD}`, and `${PASSWORD}` with your actual values. |
| 81 | + |
| 82 | + ```shell |
| 83 | + sysbench oltp_common \ |
| 84 | + --threads=${THREAD} \ |
| 85 | + --db-driver=mysql \ |
| 86 | + --mysql-db=sbtest \ |
| 87 | + --mysql-host=${HOST} \ |
| 88 | + --mysql-port=${PORT} \ |
| 89 | + --mysql-user=root \ |
| 90 | + --mysql-password=${PASSWORD} \ |
| 91 | + prepare --tables=32 --table-size=10000000 |
| 92 | + ``` |
| 93 | + |
| 94 | +4. Run the following `sysbench run` command to conduct Sysbench performance tests on different workloads. This document conducts tests on five workloads: `oltp_point_select`, `oltp_read_write`, `oltp_update_non_index`, `oltp_update_index`, and `oltp_insert`. For each workload, this document conducts three tests with the `${THREAD}` value of `100`, `200`, and `400`. For each concurrency, the test takes 20 minutes. |
| 95 | + |
| 96 | + ```shell |
| 97 | + sysbench ${WORKLOAD} run \ |
| 98 | + --mysql-host=${HOST} \ |
| 99 | + --mysql-port=${PORT} \ |
| 100 | + --mysql-user=root \ |
| 101 | + --db-driver=mysql \ |
| 102 | + --mysql-db=sbtest \ |
| 103 | + --threads=${THREAD} \ |
| 104 | + --time=1200 \ |
| 105 | + --report-interval=10 \ |
| 106 | + --tables=32 \ |
| 107 | + --table-size=10000000 \ |
| 108 | + --mysql-ignore-errors=1062,2013,8028,9007 \ |
| 109 | + --auto-inc=false \ |
| 110 | + --mysql-password=${PASSWORD} |
| 111 | + ``` |
| 112 | + |
| 113 | +## Test results |
| 114 | + |
| 115 | +This section introduces the Sysbench performance of v7.5.0 in the [test environment](#test-environment). |
| 116 | + |
| 117 | +### Point select performance |
| 118 | + |
| 119 | +The performance on the `oltp_point_select` workload is as follows: |
| 120 | + |
| 121 | +| Threads | TPS | 95% latency (ms)| |
| 122 | +|:--------|:----------|:----------| |
| 123 | +| 100 | 64,810 | 2.03 | |
| 124 | +| 200 | 118,651 | 2.22 | |
| 125 | +| 400 | 153,580 | 3.96 | |
| 126 | + |
| 127 | + |
| 128 | + |
| 129 | +### Read write performance |
| 130 | + |
| 131 | +The performance on the `oltp_read_write` workload is as follows: |
| 132 | + |
| 133 | +| Threads | TPS | 95% latency (ms)| |
| 134 | +|:--------|:----------|:----------| |
| 135 | +| 100 | 2,134 | 54.8 | |
| 136 | +| 200 | 3,020 | 99.3 | |
| 137 | +| 400 | 3,251 | 193 | |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | +### Update non-index performance |
| 142 | + |
| 143 | +The performance on the `oltp_update_non_index` workload is as follows: |
| 144 | + |
| 145 | +| Threads | TPS | 95% latency (ms)| |
| 146 | +|:--------|:----------|:----------| |
| 147 | +| 100 | 10,567 | 11.7 | |
| 148 | +| 200 | 20,223 | 13.0 | |
| 149 | +| 400 | 34,011 | 14.7 | |
| 150 | + |
| 151 | + |
| 152 | + |
| 153 | +### Update index performance |
| 154 | + |
| 155 | +The performance on the `oltp_update_index` workload is as follows: |
| 156 | + |
| 157 | +| Threads | TPS | 95% latency (ms)| |
| 158 | +|:--------|:----------|:----------| |
| 159 | +| 100 | 8,896 | 14.7 | |
| 160 | +| 200 | 1,3718 | 19.0 | |
| 161 | +| 400 | 2,0377 | 26.9 | |
| 162 | + |
| 163 | + |
| 164 | + |
| 165 | +### Insert performance |
| 166 | + |
| 167 | +The performance on the `oltp_insert` workload is as follows: |
| 168 | + |
| 169 | +| Threads | TPS | 95% latency (ms)| |
| 170 | +|:--------|:----------|:----------| |
| 171 | +| 100 | 15,132 | 8.58 | |
| 172 | +| 200 | 24,756 | 10.8 | |
| 173 | +| 400 | 37,247 | 16.4 | |
| 174 | + |
| 175 | + |
0 commit comments