TiDB Sysbench パフォーマンス テスト レポート -- v6.1.0 と v6.0.0

テストの概要

このテストは、オンライン トランザクション処理 (OLTP) シナリオにおける TiDB v6.1.0 と TiDB v6.0.0 の Sysbench パフォーマンスを比較することを目的としています。結果は、v6.1.0 の書き込みワークロードのパフォーマンスが向上していることを示しています。書き込みの多いワークロードのパフォーマンスは 2.33% ~ 4.61% 向上します。

テスト環境(AWS EC2)

ハードウェア構成

サービスの種類EC2タイプインスタンス数
PDm5.xlarge3
TiKVi3.4xlarge3
TiDBc5.4xlarge3
システムベンチc5.9xlarge1

ソフトウェアバージョン

サービスの種類ソフトウェアバージョン
PDv6.0.0 および v6.1.0
TiDBv6.0.0 および v6.1.0
TiKVv6.0.0 および v6.1.0
システムベンチ1.1.0-df89d34

パラメータ設定

TiDB v6.1.0 と TiDB v6.0.0 は同じ構成を使用します。

TiDBパラメータの設定

log.level: "error" prepared-plan-cache.enabled: true tikv-client.max-batch-wait-time: 2000000

TiKVパラメータ設定

storage.scheduler-worker-pool-size: 5 raftstore.store-pool-size: 3 raftstore.apply-pool-size: 3 rocksdb.max-background-jobs: 8 server.grpc-concurrency: 6 readpool.storage.normal-concurrency: 10

TiDB グローバル変数の設定

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; set global tidb_prepared_plan_cache_size=1000;

HAProxy 構成 - haproxy.cfg

TiDB で HAProxy を使用する方法の詳細については、 TiDB で HAProxy を使用するためのベスト プラクティスを参照してください。

global # Global configuration. pidfile /var/run/haproxy.pid # Writes the PIDs of HAProxy processes into this file. maxconn 4000 # The maximum number of concurrent connections for a single HAProxy process. user haproxy # The same with the UID parameter. group haproxy # The same with the GID parameter. A dedicated user group is recommended. nbproc 64 # The number of processes created when going daemon. When starting multiple processes to forward requests, ensure that the value is large enough so that HAProxy does not block processes. daemon # Makes the process fork into background. It is equivalent to the command line "-D" argument. It can be disabled by the command line "-db" argument. defaults # Default configuration. log global # Inherits the settings of the global configuration. retries 2 # The maximum number of retries to connect to an upstream server. If the number of connection attempts exceeds the value, the backend server is considered unavailable. timeout connect 2s # The maximum time to wait for a connection attempt to a backend server to succeed. It should be set to a shorter time if the server is located on the same LAN as HAProxy. timeout client 30000s # The maximum inactivity time on the client side. timeout server 30000s # The maximum inactivity time on the server side. listen tidb-cluster # Database load balancing. bind 0.0.0.0:3390 # The Floating IP address and listening port. mode tcp # HAProxy uses layer 4, the transport layer. balance leastconn # The server with the fewest connections receives the connection. "leastconn" is recommended where long sessions are expected, such as LDAP, SQL and TSE, rather than protocols using short sessions, such as HTTP. The algorithm is dynamic, which means that server weights might be adjusted on the fly for slow starts for instance. server tidb-1 10.9.18.229:4000 check inter 2000 rise 2 fall 3 # Detects port 4000 at a frequency of once every 2000 milliseconds. If it is detected as successful twice, the server is considered available; if it is detected as failed three times, the server is considered unavailable. server tidb-2 10.9.39.208:4000 check inter 2000 rise 2 fall 3 server tidb-3 10.9.64.166:4000 check inter 2000 rise 2 fall 3

テスト計画

  1. TiUPを使用して TiDB v6.1.0 および v6.0.0をデプロイ。
  2. Sysbench を使用して、各テーブルに 1,000 万行のデータが含まれる 16 のテーブルをインポートします。
  3. 各テーブルに対してanalyze tableステートメントを実行します。
  4. さまざまな同時実行テストの前に、復元に使用されるデータをバックアップします。これにより、各テストのデータの一貫性が確保されます。
  5. Sysbench クライアントを起動して、 point_selectread_writeupdate_index 、およびupdate_non_indexテストを実行します。 HAProxy を介して TiDB でストレス テストを実行します。各ワークロードでの同時実行ごとに、テストには 20 分かかります。
  6. 各種類のテストが完了したら、クラスターを停止し、手順 4 のバックアップ データでクラスターを上書きし、クラスターを再起動します。

テストデータの準備

次のコマンドを実行してテスト データを準備します。

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

テストを実行する

次のコマンドを実行してテストを実行します。

sysbench $testname \ --threads=$threads \ --time=1200 \ --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

試験結果

ポイントセレクト性能

スレッドv6.0.0 TPSv6.1.0 TPSv6.0.0 95%レイテンシー(ミリ秒)v6.1.0 95%レイテンシー(ミリ秒)TPS の向上 (%)
300268934.84265353.151.891.96-1.33
600365217.96358976.942.572.66-1.71
900420799.64407625.113.683.82-3.13

v6.0.0 と比較すると、v6.1.0 のポイント選択パフォーマンスは 2.1% わずかに低下します。

Point Select

インデックス以外のパフォーマンスを更新する

スレッドv6.0.0 TPSv6.1.0 TPSv6.0.0 95%レイテンシー(ミリ秒)v6.1.0 95%レイテンシー(ミリ秒)TPS の向上 (%)
30041778.9542991.911.2411.452.90
60052045.3954099.5820.7420.373.95
90059243.3562084.6527.6626.684.80

v6.0.0 と比較して、v6.1.0 の非インデックス更新のパフォーマンスは 3.88% 向上しています。

Update Non-index

インデックスのパフォーマンスを更新する

スレッドv6.0.0 TPSv6.1.0 TPSv6.0.0 95%レイテンシー(ミリ秒)v6.1.0 95%レイテンシー(ミリ秒)TPS の向上 (%)
30018085.7919198.8925.2823.956.15
60022210.822877.5842.6141.853.00
90025249.8126431.1255.8253.854.68

v6.0.0 と比較して、v6.1.0 の更新インデックスのパフォーマンスは 4.61% 向上しています。

Update Index

読み取り/書き込みパフォーマンス

スレッドv6.0.0 TPSv6.1.0 TPSv6.0.0 95%レイテンシー(ミリ秒)v6.1.0 95%レイテンシー(ミリ秒)TPS の向上 (%)
3004856.234914.1184.4782.961.19
6005676.465848.09161.51150.293.02
9006072.976223.95240.02223.342.49

v6.0.0 と比較して、v6.1.0 の読み取り/書き込みパフォーマンスは 2.23% 向上しています。

Read Write

このページは役に立ちましたか?

Playground
新規
登録なしで TiDB の機能をワンストップでインタラクティブに体験できます。
製品
TiDB Cloud
TiDB
価格
PoC お問い合わせ
エコシステム
TiKV
TiFlash
OSS Insight
© 2024 PingCAP. All Rights Reserved.
Privacy Policy.