TiDB正式线上前,总是要对TiDB做个压测来为后续的业务接入做评估依旧;本次针对TiDB 5.0以及MySQL 8.0在同等规格配置下,性能做一个对比,尽管来说这么对比,可比性不是很强,但是起码能为后续业务的接入以及上线有一个理论依旧;
测试环境
测试方案
TiKV v5.0 参数配置
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
测试流程
./sysbench --config-file=config oltp_point_select --tables=10 --table-size=10000000 prepare
./sysbench --config-file=config oltp_read_write --tables=10 --table-size=10000000 run
| 线程数/QPS | 16 | 32 | 64 | 128 |
| TiDB(3个TiKV) | 16117.78 | 20248.98 | 21868.97 | 23389.03 |
| TiDB(4个TiKV) | 15908.46 | 19708.92 | 21425.77 | 23425.17 |
| TiDB(5个TiKV) | 16008.85 | 19758.88 | 21491.36 | 22925.59 |
| MySQL 8.0 | 50089.04 | 67339.98 | 86560.56 | 92353.55 |
从上面的测试结果,可以看到针对单个TiDB节点测试,同样配置、相同线程下,TiDB集群的QPS要远远低于MySQL 8.0;




| 线程数/QPS | 16 | 32 | 64 | 128 |
| TiDB(3个TiKV) | 16117.78 | 20248.98 | 21868.97 | 23389.03 |
| TiDB(4个TiKV) | 15908.46 | 19708.92 | 21425.77 | 23425.17 |
| TiDB(5个TiKV) | 16008.85 | 19758.88 | 21491.36 | 22925.59 |
| MySQL 8.0 | 50089.04 | 67339.98 | 86560.56 | 92353.55 |
| HAProxy-TiDB | 36346.55 | 51929.55 | 60201.5 | 63767.53 |
从测试结果看,从TiDB Server在负载均衡的情况,整个TiDB集群的资源使用情况有所提高,QPS对比单个TiDB Server节点有明显的提高,而且节点的负载基本差不多,网络吞吐量明显提高;

文章转载自DBA的辛酸事儿,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




