MySQL5.7 GR VS MariaDB10.1.19 Galera Cluster性能壓測
視頻演示:http://pan.baidu.com/s/1sk87tfB
架構
工具sysbench0.5 128併發 10張表100萬行
硬件配置R720 64G RAID10(SAS 15000轉)
192.168.143.244 gr(primary-3306端口) Galera(secondary-3308端口)
192.168.143.245 gr(secondary-3306端口) Galera(primary-3308端口)
192.168.143.246 gr(secondary-3306端口) Galera(secondary-3308端口)
咱們這裏純粹是爲了跑性能。
gr我關閉了限流group_replication_flow_control_mode = 'DISABLED'。因數據複製是經過binlog,這裏我採用基於表的並行複製,slave_parallel_type = 'LOGICAL_CLOCK',開啓並行複製線程slave_parallel_workers設置了24個線程。併發
Galera我將gcs.fc_limit設置了1000K,調整成最大,避免限流。開啓並行複製線程wsrep_slave_threads設置了24個線程。
gr壓測192.168.143.244,Galera壓測192.168.143.245。BP都是30G
下面廢話很少說,看視頻演示,數聽說話!
ide
--------------------------------------------------------------------------------
GR
[ 10s] threads: 128, tps: 768.46, reads: 10937.14, writes: 2339.68, response time: 335.94ms (95%), errors: 0.00, reconnects: 0.00
[ 20s] threads: 128, tps: 1009.40, reads: 14132.12, writes: 3031.30, response time: 214.42ms (95%), errors: 0.00, reconnects: 0.00
[ 30s] threads: 128, tps: 1060.00, reads: 14840.01, writes: 3179.30, response time: 195.94ms (95%), errors: 0.00, reconnects: 0.00
[ 40s] threads: 128, tps: 1042.69, reads: 14597.30, writes: 3129.28, response time: 203.54ms (95%), errors: 0.00, reconnects: 0.00
[ 50s] threads: 128, tps: 1083.11, reads: 15163.89, writes: 3249.42, response time: 189.03ms (95%), errors: 0.00, reconnects: 0.00
[ 60s] threads: 128, tps: 979.30, reads: 13710.20, writes: 2938.00, response time: 210.79ms (95%), errors: 0.00, reconnects: 0.00
[ 70s] threads: 128, tps: 974.39, reads: 13641.44, writes: 2922.97, response time: 199.02ms (95%), errors: 0.00, reconnects: 0.00
[ 80s] threads: 128, tps: 762.01, reads: 10593.03, writes: 2267.93, response time: 360.43ms (95%), errors: 0.00, reconnects: 0.00
[ 90s] threads: 128, tps: 960.30, reads: 13519.30, writes: 2897.30, response time: 286.83ms (95%), errors: 0.00, reconnects: 0.00
[ 100s] threads: 128, tps: 1015.30, reads: 14214.20, writes: 3046.30, response time: 188.41ms (95%), errors: 0.00, reconnects: 0.00
工具
--------------------------------------------------------------------------------------
Galera
[ 10s] threads: 128, tps: 1207.93, reads: 17081.43, writes: 3656.79, response time: 113.88ms (95%), errors: 0.00, reconnects: 0.00
[ 20s] threads: 128, tps: 1302.00, reads: 18227.01, writes: 3904.70, response time: 112.76ms (95%), errors: 0.00, reconnects: 0.00
[ 30s] threads: 128, tps: 1287.10, reads: 18021.19, writes: 3863.00, response time: 112.79ms (95%), errors: 0.00, reconnects: 0.00
[ 40s] threads: 128, tps: 1279.60, reads: 17913.70, writes: 3839.20, response time: 114.97ms (95%), errors: 0.00, reconnects: 0.00
[ 50s] threads: 128, tps: 1289.80, reads: 18058.41, writes: 3869.70, response time: 114.46ms (95%), errors: 0.00, reconnects: 0.00
[ 60s] threads: 128, tps: 1275.20, reads: 17850.90, writes: 3824.90, response time: 116.12ms (95%), errors: 0.00, reconnects: 0.00
[ 70s] threads: 128, tps: 1243.30, reads: 17406.47, writes: 3729.99, response time: 118.15ms (95%), errors: 0.00, reconnects: 0.00
[ 80s] threads: 128, tps: 1287.20, reads: 18020.37, writes: 3861.19, response time: 114.08ms (95%), errors: 0.00, reconnects: 0.00
[ 90s] threads: 128, tps: 1283.20, reads: 17967.07, writes: 3850.01, response time: 114.70ms (95%), errors: 0.00, reconnects: 0.00
[ 100s] threads: 128, tps: 1261.30, reads: 17656.79, writes: 3783.50, response time: 117.41ms (95%), errors: 0.00, reconnects: 0.00性能
總結
spa
GR和Galera的性能不及半同步複製,若是您對性能要求較高,數據一致性不太在乎,建議用MariaDB 10.1.X Loss-Less Semi replication+MHA高可用架構。線程
關於GR和Galera,在部署生產環境中多作幾回壓測,選擇一款適合您的。視頻