【 TiDB 使用环境】
系统均采用conts7
3台虚拟机,32C+32G
tiup安装5.4.1
测试使用sysbench
参考官方测试文档:https://docs.pingcap.com/zh/tidb/v5.4/benchmark-sysbench-v5.4.0-vs-v5.3.0
集群部署按照官方进行调优,参考:https://docs.pingcap.com/zh/tidb/v5.4/check-before-deployment
【概述】 场景 + 问题概述
测试命令
sysbench /usr/local/share/sysbench/tests/include/oltp_legacy/oltp.lua
–threads=32
–time=120
–oltp-test-mode=complex
–report-interval=1
–db-driver=mysql
–mysql-db=test
–mysql-host=127.0.0.1
–mysql-port=4000
–mysql-user=root
–mysql-password=’’
run --tables=10 --table-size=1000000
【测试结果】
Running the test with following options:
Number of threads: 32
Report intermediate results every 1 second(s)
Initializing random number generator from current time
Initializing worker threads…
Threads started!
[ 1s ] thds: 32 tps: 416.98 qps: 8742.65 (r/w/o: 6179.07/1696.78/866.80) lat (ms,95%): 127.81 err/s: 1.99 reconn/s: 0.00
[ 2s ] thds: 32 tps: 466.10 qps: 9411.10 (r/w/o: 6590.47/1885.42/935.21) lat (ms,95%): 114.72 err/s: 4.00 reconn/s: 0.00
[ 3s ] thds: 32 tps: 456.06 qps: 9200.30 (r/w/o: 6464.91/1820.26/915.13) lat (ms,95%): 121.08 err/s: 1.00 reconn/s: 0.00
[ 4s ] thds: 32 tps: 453.04 qps: 8951.88 (r/w/o: 6248.62/1801.18/902.09) lat (ms,95%): 137.35 err/s: 0.00 reconn/s: 0.00
[ 5s ] thds: 32 tps: 471.86 qps: 9554.10 (r/w/o: 6705.97/1899.42/948.71) lat (ms,95%): 112.67 err/s: 1.00 reconn/s: 0.00
[ 6s ] thds: 32 tps: 475.09 qps: 9506.72 (r/w/o: 6650.20/1905.34/951.17) lat (ms,95%): 108.68 err/s: 1.00 reconn/s: 0.00
[ 7s ] thds: 32 tps: 472.97 qps: 9412.31 (r/w/o: 6585.52/1879.86/946.93) lat (ms,95%): 112.67 err/s: 1.00 reconn/s: 0.00
[ 8s ] thds: 32 tps: 464.41 qps: 9388.10 (r/w/o: 6588.65/1869.63/929.82) lat (ms,95%): 118.92 err/s: 1.00 reconn/s: 0.00
[ 9s ] thds: 32 tps: 446.45 qps: 8890.98 (r/w/o: 6213.27/1782.80/894.90) lat (ms,95%): 139.85 err/s: 2.00 reconn/s: 0.00
[ 10s ] thds: 32 tps: 467.03 qps: 9340.66 (r/w/o: 6539.46/1866.13/935.07) lat (ms,95%): 118.92 err/s: 1.00 reconn/s: 0.00
SQL statistics:
queries performed:
read: 64932
write: 18522
other: 9262
total: 92716
transactions: 4624 (458.37 per sec.)
queries: 92716 (9190.89 per sec.)
ignored errors: 14 (1.39 per sec.)
reconnects: 0 (0.00 per sec.)
General statistics:
total time: 10.0853s
total number of events: 4624
Latency (ms):
min: 33.13
avg: 69.44
max: 342.81
95th percentile: 121.08
sum: 321088.75
Threads fairness:
events (avg/stddev): 144.5000/3.81
execution time (avg/stddev): 10.0340/0.02
【问题】
1、3个节点只有连接tidb的CPU使用30%左右,其他tidb cpu使用率个位数。
2、3个节点io使用率70-80%。
3、测试tps低,还有err错误。