Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
c361b04
Update translation.yaml
shhdgit Dec 1, 2023
0e5e300
Update translation.yaml
shhdgit Dec 1, 2023
d383365
Update translation.yaml
shhdgit Dec 1, 2023
1b478ca
Merge branch 'pingcap:master' into master
shhdgit Dec 7, 2023
ce3e39e
Update cron.yml
shhdgit Dec 7, 2023
9184833
docs: add documentation for ADMIN ALTER DDL JOBS command (#19492)
tangenta Dec 2, 2024
a6ed826
Update hardware-and-software-requirements.md (#19539)
wuhuizuo Dec 3, 2024
4a5c722
privilege: change privilege for SHOW PROCESSLIST from SUPER to PROCES…
hfxsd Dec 4, 2024
52107dd
*: update TiDB community channel descriptions and links (#19556)
lilin90 Dec 4, 2024
4f3ec13
remove https://github.com/apps/renovate from release notes (#19567)
hfxsd Dec 4, 2024
63dd5ed
tiflash: Fix format_version description (#19577)
JaySon-Huang Dec 5, 2024
6c145a5
store limit v2: remove experimental description (#19552)
Oreoxmt Dec 5, 2024
b13021b
Update timezone docs (#19067)
dveeden Dec 5, 2024
f7979b6
Update optimizer-fix-controls.md (#19515)
ghazalfamilyusa Dec 5, 2024
0c638dd
Optimizing TiDB Settings for Maximum Performance (#19029)
dbsid Dec 5, 2024
b5fa13a
ticdc: fix alert doc (#19596)
CharlesCheung96 Dec 6, 2024
4814eb2
Emphasis the importance of input of unsafe recovery (#19595)
qiancai Dec 6, 2024
41bd759
update OWNERS (#19599)
qiancai Dec 6, 2024
4a6d0b0
tidb-cloud: update dev-guide-overview.md (#19612)
shhdgit Dec 9, 2024
826ca2d
sync_diff_inspector: add the check-data-only configuration item (#19606)
joechenrh Dec 9, 2024
4db5234
Announce GA of memory control on stats cache (#19604)
songrijie Dec 9, 2024
94447d5
Recommend RC instead of SQL Priority (#19605)
songrijie Dec 9, 2024
a8c8fb4
Add IME doc (#19506)
overvenus Dec 9, 2024
3e2409c
tiup: restriction about DXF (#19632)
hfxsd Dec 9, 2024
017a9c8
performance: remove tidb_enable_batch_dml (#19633)
dbsid Dec 10, 2024
3912e15
OWNERS: Auto Sync OWNERS files from community membership (#19613)
ti-chi-bot Dec 10, 2024
5e9142e
br: change the default value of table-level checksum to false (#19640)
qiancai Dec 10, 2024
85ce20d
pd: add patrol-region-worker-count (#19600)
Oreoxmt Dec 11, 2024
9724b36
br: change the default value of table-level checksum to false (#19640…
ti-chi-bot Dec 11, 2024
3ae7309
sql: fix the synopsis of `REVOKE <privileges>` (#19659)
Oreoxmt Dec 12, 2024
38354e9
Update explain and execution summary related docs (#19651)
yibin87 Dec 13, 2024
29a7c8d
planner: update the fix-control doc (#19520)
qw4990 Dec 13, 2024
dd1cca9
deploy: add glibc 2.28 requirements (#19667)
Oreoxmt Dec 13, 2024
da0d150
tiup: refine description about `tiup playground --tag` (#19669)
hfxsd Dec 13, 2024
95a6343
planner: update the default value of 46177 (#19686)
Oreoxmt Dec 13, 2024
67712d4
flashback: add limitation with stale read/snapshot (#19347)
qiancai Dec 16, 2024
15b8ea5
fix version-mark format for shared-blob-cache (#19704)
Oreoxmt Dec 16, 2024
1ba2016
develop: fix CURD to CRUD (#19706)
lilin90 Dec 16, 2024
92f3d77
*: improve deployment doc and toc (#19653)
lilin90 Dec 17, 2024
a3ba93a
Update get-en-duplicated-notes.py (#19723)
qiancai Dec 18, 2024
fda8852
wrong-index-solution: update (#19286)
dveeden Dec 19, 2024
c971092
update basic-features.md for v8.5 (#19471)
qiancai Dec 19, 2024
a832728
add v8.5.0 release notes (#19336)
qiancai Dec 19, 2024
ec29eb8
bump the latest version of TiDB to v8.5 (#19525)
qiancai Dec 19, 2024
476a051
check-before-deployment: add selinux (#19703)
dveeden Dec 20, 2024
6b5a7a2
Add the "toml" code fence to TiKV config (#19742)
lilin90 Dec 20, 2024
c2a201a
Merge branch 'master' of github.com:pingcap/docs
shhdgit Dec 20, 2024
0d25c8b
update(ci): ja translation
shhdgit Dec 20, 2024
81d6c84
add warnings for CentOS 7 usage (#19752) (#19753)
ti-chi-bot Dec 20, 2024
14c73be
update(ci): ja translation (#19754)
shhdgit Dec 20, 2024
e305510
update(ci): ja translation (#19756)
shhdgit Dec 20, 2024
4d4ca68
test: ci
shhdgit Dec 20, 2024
65b4929
Merge branch 'master' of github.com:shhdgit/docs-1
shhdgit Dec 20, 2024
0409194
test: ci
shhdgit Dec 20, 2024
f32ade6
Merge branch 'master' of github.com:pingcap/docs
shhdgit Dec 20, 2024
baa7ee3
ci: cron test
shhdgit Dec 23, 2024
cc9e0f9
ci: cron test
shhdgit Dec 23, 2024
3ad9c93
ci: cron test
shhdgit Dec 23, 2024
d507188
ci: cron test
shhdgit Dec 23, 2024
83cb03d
ci: cron test
shhdgit Dec 23, 2024
1cfebdc
ci: cron test
shhdgit Dec 23, 2024
9f09129
ci: test
shhdgit Dec 23, 2024
d299073
ci: test
shhdgit Dec 23, 2024
98be4aa
ci: test
shhdgit Dec 23, 2024
cbf8535
ci: test
shhdgit Dec 23, 2024
973ddbf
ci: test
shhdgit Dec 23, 2024
5d4472b
ci: test
shhdgit Dec 23, 2024
41e6064
ci: test
shhdgit Dec 23, 2024
89b9dac
ci: test
shhdgit Dec 23, 2024
11aaf5e
ci: test
shhdgit Dec 23, 2024
90a2568
ci: test
shhdgit Dec 23, 2024
419e7a9
ci: test
shhdgit Dec 23, 2024
3499f1e
Merge branch 'temp-merge-branch' into i18n-zh-release-8.5
invalid-email-address Jul 16, 2025
fa69f2f
ci: update latest_translation_commit.json for release-8.5
invalid-email-address Jul 16, 2025
fabe697
[create-pull-request] automated change
github-actions[bot] Oct 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
223 changes: 223 additions & 0 deletions benchmark/benchmark-sysbench-v5-vs-v4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
---
title: TiDB Sysbench Performance Test Report -- v5.0 vs. v4.0
summary: TiDB v5.0 outperforms v4.0 in Sysbench performance tests. Point Select performance improved by 2.7%, Update Non-index by 81%, Update Index by 28%, and Read Write by 9%. The test aimed to compare performance in the OLTP scenario using AWS EC2. Test results were presented in tables and graphs.
---

# TiDB Sysbench Performance Test Report -- v5.0 vs. v4.0

## Test purpose

This test aims at comparing the Sysbench performance of TiDB v5.0 and TiDB v4.0 in the Online Transactional Processing (OLTP) scenario.

## Test environment (AWS EC2)

### Hardware configuration

| Service type | EC2 type | Instance count |
|:----------|:----------|:----------|
| PD | m5.xlarge | 3 |
| TiKV | i3.4xlarge| 3 |
| TiDB | c5.4xlarge| 3 |
| Sysbench | c5.9xlarge| 1 |

### Software version

| Service type | Software version |
|:----------|:-----------|
| PD | 4.0 and 5.0 |
| TiDB | 4.0 and 5.0 |
| TiKV | 4.0 and 5.0 |
| Sysbench | 1.0.20 |

### Parameter configuration

#### TiDB v4.0 configuration

{{< copyable "" >}}

```yaml
log.level: "error"
performance.max-procs: 20
prepared-plan-cache.enabled: true
tikv-client.max-batch-wait-time: 2000000
```

#### TiKV v4.0 configuration

{{< copyable "" >}}

```yaml
storage.scheduler-worker-pool-size: 5
raftstore.store-pool-size: 3
raftstore.apply-pool-size: 3
rocksdb.max-background-jobs: 3
raftdb.max-background-jobs: 3
raftdb.allow-concurrent-memtable-write: true
server.grpc-concurrency: 6
readpool.unified.min-thread-count: 5
readpool.unified.max-thread-count: 20
readpool.storage.normal-concurrency: 10
pessimistic-txn.pipelined: true
```

#### TiDB v5.0 configuration

{{< copyable "" >}}

```yaml
log.level: "error"
performance.max-procs: 20
prepared-plan-cache.enabled: true
tikv-client.max-batch-wait-time: 2000000
```

#### TiKV v5.0 configuration

{{< copyable "" >}}

```yaml
storage.scheduler-worker-pool-size: 5
raftstore.store-pool-size: 3
raftstore.apply-pool-size: 3
rocksdb.max-background-jobs: 8
raftdb.max-background-jobs: 4
raftdb.allow-concurrent-memtable-write: true
server.grpc-concurrency: 6
readpool.unified.min-thread-count: 5
readpool.unified.max-thread-count: 20
readpool.storage.normal-concurrency: 10
pessimistic-txn.pipelined: true
server.enable-request-batch: false
```

#### TiDB v4.0 global variable configuration

{{< copyable "sql" >}}

```sql
set global tidb_hashagg_final_concurrency=1;
set global tidb_hashagg_partial_concurrency=1;
```

#### TiDB v5.0 global variable configuration

{{< copyable "sql" >}}

```sql
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;

```

## Test plan

1. Deploy TiDB v5.0 and v4.0 using TiUP.
2. Use Sysbench to import 16 tables, each table with 10 million rows of data.
3. Execute the `analyze table` statement on each table.
4. Back up the data used for restore before different concurrency tests, which ensures data consistency for each test.
5. Start the Sysbench client to perform the `point_select`, `read_write`, `update_index`, and `update_non_index` tests. Perform stress tests on TiDB via AWS NLB. In each type of test, the warm-up takes 1 minute and the test takes 5 minutes.
6. After each type of test is completed, stop the cluster, overwrite the cluster with the backup data in step 4, and restart the cluster.

### Prepare test data

Execute the following command to prepare the test data:

{{< copyable "shell-regular" >}}

```bash
sysbench oltp_common \
--threads=16 \
--rand-type=uniform \
--db-driver=mysql \
--mysql-db=sbtest \
--mysql-host=$aws_nlb_host \
--mysql-port=$aws_nlb_port \
--mysql-user=root \
--mysql-password=password \
prepare --tables=16 --table-size=10000000
```

### Perform the test

Execute the following command to perform the test.

{{< copyable "shell-regular" >}}

```bash
sysbench $testname \
--threads=$threads \
--time=300 \
--report-interval=1 \
--rand-type=uniform \
--db-driver=mysql \
--mysql-db=sbtest \
--mysql-host=$aws_nlb_host \
--mysql-port=$aws_nlb_port \
run --tables=16 --table-size=10000000
```

## Test results

### Point Select performance

| Threads | v4.0 QPS | v4.0 95% latency (ms) | v5.0 QPS | v5.0 95% latency (ms) | QPS improvement |
|:----------|:----------|:----------|:----------|:----------|:----------|
| 150 | 159451.19 | 1.32 | 177876.25 | 1.23 | 11.56% |
| 300 | 244790.38 | 1.96 | 252675.03 | 1.82 | 3.22% |
| 600 | 322929.05 | 3.75 | 331956.84 | 3.36 | 2.80% |
| 900 | 364840.05 | 5.67 | 365655.04 | 5.09 | 0.22% |
| 1200 | 376529.18 | 7.98 | 366507.47 | 7.04 | -2.66% |
| 1500 | 368390.52 | 10.84 | 372476.35 | 8.90 | 1.11% |

Compared with v4.0, the Point Select performance of TiDB v5.0 has increased by 2.7%.

![Point Select](/media/sysbench_v5vsv4_point_select.png)

### Update Non-index performance

| Threads | v4.0 QPS | v4.0 95% latency (ms) | v5.0 QPS | v5.0 95% latency (ms) | QPS improvement |
|:----------|:----------|:----------|:----------|:----------|:----------|
| 150 | 17243.78 | 11.04 | 30866.23 | 6.91 | 79.00% |
| 300 | 25397.06 | 15.83 | 45915.39 | 9.73 | 80.79% |
| 600 | 33388.08 | 25.28 | 60098.52 | 16.41 | 80.00% |
| 900 | 38291.75 | 36.89 | 70317.41 | 21.89 | 83.64% |
| 1200 | 41003.46 | 55.82 | 76376.22 | 28.67 | 86.27% |
| 1500 | 44702.84 | 62.19 | 80234.58 | 34.95 | 79.48% |

Compared with v4.0, the Update Non-index performance of TiDB v5.0 has increased by 81%.

![Update Non-index](/media/sysbench_v5vsv4_update_non_index.png)

### Update Index performance

| Threads | v4.0 QPS | v4.0 95% latency (ms) | v5.0 QPS | v5.0 95% latency (ms) | QPS improvement |
|:----------|:----------|:----------|:----------|:----------|:----------|
| 150 | 11736.21 | 17.01 | 15631.34 | 17.01 | 33.19% |
| 300 | 15435.95 | 28.67 | 19957.06 | 22.69 | 29.29% |
| 600 | 18983.21 | 49.21 | 23218.14 | 41.85 | 22.31% |
| 900 | 20855.29 | 74.46 | 26226.76 | 53.85 | 25.76% |
| 1200 | 21887.64 | 102.97 | 28505.41 | 69.29 | 30.24% |
| 1500 | 23621.15 | 110.66 | 30341.06 | 82.96 | 28.45% |

Compared with v4.0, the Update Index performance of TiDB v5.0 has increased by 28%.

![Update Index](/media/sysbench_v5vsv4_update_index.png)

### Read Write performance

| Threads | v4.0 QPS | v4.0 95% latency (ms) | v5.0 QPS | v5.0 95% latency (ms) | QPS improvement |
|:----------|:----------|:----------|:----------|:----------|:----------|
| 150 | 59979.91 | 61.08 | 66098.57 | 55.82 | 10.20% |
| 300 | 77118.32 | 102.97 | 84639.48 | 90.78 | 9.75% |
| 600 | 90619.52 | 183.21 | 101477.46 | 167.44 | 11.98% |
| 900 | 97085.57 | 267.41 | 109463.46 | 240.02 | 12.75% |
| 1200 | 106521.61 | 331.91 | 115416.05 | 320.17 | 8.35% |
| 1500 | 116278.96 | 363.18 | 118807.5 | 411.96 | 2.17% |

Compared with v4.0, the read-write performance of TiDB v5.0 has increased by 9%.

![Read Write](/media/sysbench_v5vsv4_read_write.png)
Loading