TiDBSysbenchパフォーマンステストレポート-v5.4.0とv5.3.0

テストの概要

このテストは、オンライントランザクション処理(OLTP)シナリオでのTiDBv5.4.0とTiDBv5.3.0のSysbenchパフォーマンスを比較することを目的としています。結果は、v5.4.0のパフォーマンスが、書き込みの多いワークロードで2.59%〜4.85%向上することを示しています。

テスト環境(AWS EC2)

ハードウェア構成

サービスの種類EC2タイプインスタンス数
PDm5.xlarge3
TiKVi3.4xlarge3
TiDBc5.4xlarge3
Sysbenchc5.9xlarge1

ソフトウェアバージョン

サービスの種類ソフトウェアバージョン
PDv5.3.0およびv5.4.0
TiDBv5.3.0およびv5.4.0
TiKVv5.3.0およびv5.4.0
Sysbench1.1.0-ead2689

パラメータ設定

TiDBv5.4.0とTiDBv5.3.0は同じ構成を使用します。

TiDBパラメータ設定

log.level: "error" performance.max-procs: 20 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 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

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;

HAProxy設定-haproxy.cfg

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

global # Global configuration. chroot /var/lib/haproxy # Changes the current directory and sets superuser privileges for the startup process to improve security. 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 roundrobin # 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. デプロイを使用してTiDBv5.4.0およびv5.3.0を展開します。
  2. Sysbenchを使用して、16個のテーブルをインポートします。各テーブルには、1,000万行のデータが含まれています。
  3. 各テーブルでanalyze tableのステートメントを実行します。
  4. さまざまな同時実行テストの前に復元に使用されるデータをバックアップします。これにより、各テストのデータの一貫性が保証されます。
  5. read_writeクライアントを起動して、 point_select 、およびupdate_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

試験結果

ポイントセレクトパフォーマンス

スレッドv5.3.0 TPSv5.4.0 TPSv5.3.0 95%の遅延(ミリ秒)v5.4.0 95%の遅延(ミリ秒)TPSの改善(%)
300266041.84264345.731.962.07-0.64
600351782.71348715.983.433.49-0.87
900386553.31399777.115.094.743.42

v5.3.0と比較して、v5.4.0のポイント選択のパフォーマンスは0.64%わずかに向上しています。

Point Select

非インデックスパフォーマンスの更新

スレッドv5.3.0 TPSv5.4.0 TPSv5.3.0 95%の遅延(ミリ秒)v5.4.0 95%の遅延(ミリ秒)TPSの改善(%)
30040804.3141187.111.8711.870.94
60051239.453172.0320.7419.653.77
90057897.5659666.827.6627.663.06

v5.3.0と比較して、v5.4.0の非インデックスの更新のパフォーマンスは2.59%向上しています。

Update Non-index

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

スレッドv5.3.0 TPSv5.4.0 TPSv5.3.0 95%の遅延(ミリ秒)v5.4.0 95%の遅延(ミリ秒)TPSの改善(%)
30017737.8218716.526.224.835.52
60021614.3922670.7444.9842.614.89
90023933.724922.0562.1961.084.13

v5.3.0と比較して、v5.4.0の更新インデックスのパフォーマンスは4.85%向上しています。

Update Index

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

スレッドv5.3.0 TPSv5.4.0 TPSv5.3.0 95%の遅延(ミリ秒)v5.4.0 95%の遅延(ミリ秒)TPSの改善(%)
3003810.783929.29108.68106.753.11
6004514.284684.64193.38186.543.77
9004842.494988.49282.25277.213.01

v5.3.0と比較して、v5.4.0の読み取り/書き込みパフォーマンスは3.30%向上しています。

Read Write

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

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