地方エンジニアの学習日記

興味ある技術の雑なメモだったりを書いてくブログ。たまに日記とガジェット紹介。

【TiDB】Macに入れてsysbenchを実行してみた

MySQLbrewで入れてTiDBはtiupで立ち上げた直後にsysbenchを実行してみた結果。Mac上でDBを上げてMac上でsysbenchも実行するという本番ではまあ無いような構成でやっています。結果としてはMySQLの方が倍近いQPSを出していました。TiDBのスケールアップも試してみたが大きく数値は変わらず。あまり有用なデータは取れませんでした。なんでだろ。

DB QPS
MySQL 5811.14
TiDB 2063.65

MySQL

sysbench oltp_read_write --table-size=1000000 --mysql-db=test --mysql-user=root --mysql-host=127.0.0.1 --mysql-port=3306 run
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Initializing worker threads...

Threads started!

SQL statistics:
    queries performed:
        read:                            40698
        write:                           11628
        other:                           5814
        total:                           58140
    transactions:                        2907   (290.56 per sec.)
    queries:                             58140  (5811.14 per sec.)
    ignored errors:                      0      (0.00 per sec.)
    reconnects:                          0      (0.00 per sec.)

General statistics:
    total time:                          10.0037s
    total number of events:              2907

Latency (ms):
         min:                                    2.04
         avg:                                    3.44
         max:                                   63.05
         95th percentile:                        3.55
         sum:                                 9997.75

Threads fairness:
    events (avg/stddev):           2907.0000/0.00
    execution time (avg/stddev):   9.9977/0.00

TiDB

sysbench oltp_read_write --table-size=1000000 --mysql-db=test --mysql-user=root --mysql-host=127.0.0.1 --mysql-port=4000 run
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Initializing worker threads...

Threads started!

SQL statistics:
    queries performed:
        read:                            14448
        write:                           4124
        other:                           2068
        total:                           20640
    transactions:                        1032   (103.18 per sec.)
    queries:                             20640  (2063.65 per sec.)
    ignored errors:                      0      (0.00 per sec.)
    reconnects:                          0      (0.00 per sec.)

General statistics:
    total time:                          10.0007s
    total number of events:              1032

Latency (ms):
         min:                                    7.20
         avg:                                    9.69
         max:                                   55.58
         95th percentile:                       23.95
         sum:                                 9997.03

Threads fairness:
    events (avg/stddev):           1032.0000/0.00
    execution time (avg/stddev):   9.9970/0.00