强同步性能对比数据
最近更新时间:2022-04-24 15:05:13
本文提供 MariaDB 与开源 MySQL(未经优化)的性能对比,用于做对比参考。
对比测试环境
- 硬件:CPU 24core ,内存128GB,磁盘1.8TB SSD
- 网络环境:局域网,平均网络延迟0.80ms
- 操作系统:CentOS 7.0
- 数据量:10张表,每张表2180000行,每张表数据量约5.2GB,innodb buffer:30GB
- 开源版本:MySQL 5.6 社区版(未经优化,开启异步同步)
- MariaDB 分片版本: MariaDB 10.1.10(内核优化,开启强同步),默认开启线程池
对比测试结果
综合来看,经过优化的 MariaDB 的强同步性能略优于 MySQL 的异步性能。
对比测试详细数据
测试操作
1. 数据初始化参数
create database caccts ;
./sysbench --num-threads=500 --test=./tests/db/oltp.lua.bak --oltp-table-size=2180000 --oltp-tables-count=10 --oltp-point-selects=1 --oltp-simple-ranges=0 --oltp-sum-ranges=0 --oltp-order-ranges=0 --oltp-index-updates=1 --oltp-non-index-updates=0 --report-interval=1 --mysql-user=xxxxxx --mysql-password=xxxxxx --mysql-host=xxxxxx --mysql-db=caccts --max-time=360000 --max-requests=2000000000 prepare
2. 非索引更新(update)
./sysbench --num-threads=500 --test=./tests/db/update\_non\_index.lua --oltp-table-size=2180000 --oltp-tables-count=10 --percentile=99 --report-interval=1 --mysql-host=xxxx --mysql-user=xxx --mysql-password=xxx --mysql-db=caccts --max-time=360000 --max-requests=2000000000 --mysql-port=3306 run
3. 只读(select)
./sysbench --num-threads=500 --test=./tests/db/select.lua --oltp-table-size=2180000 --oltp-tables-count=10 --percentile=99 --report-interval=1 --mysql-host=xxxx --mysql-user=xxx --mysql-password=xxx --mysql-db=caccts --max-time=360000 -- max-requests=2000000000 --mysql-port=3306 run
4. 混合测试
./sysbench\_orig --num-threads=500 --test=./tests/db/oltp\_new.lua --oltp-read-only=off --oltp-table-size=2180000 --oltp-tables-count=10 --oltp-point-selects=1 --oltp-simple-ranges=0 --oltp-sum-ranges=0 --oltp-order-ranges=0 --oltp-distinct-ranges=0 --oltp-index-updates=1 --oltp-non-index-updates=0 --percentile=99 --report-interval=1 --mysql-host=xxxx -- mysql-user=xxx --mysql-password=xxx --mysql-db=caccts --max-time=360000 --max-requests=2000000000 --mysql-port=3306 run
对比测试结果
1. 读请求(read)
并发 |
版本 |
qps |
平均响应时间(ms) |
99%响应时间(ms) |
50 |
开源 MySQL |
306512 |
0.16 |
0.26 |
50 |
MariaDB |
310695 |
0.15 |
0.24 |
100 |
开源 MySQL |
417443 |
0.24 |
0.48 |
100 |
MariaDB |
454640 |
0.2 |
0.72 |
200 |
开源 MySQL |
423419 |
0.57 |
1 |
200 |
MariaDB |
488224 |
0.56 |
1.22 |
500 |
开源 MySQL |
438512 |
1.16 |
2.42 |
500 |
MariaDB |
490678 |
1.21 |
2.61 |
1000 |
开源 MySQL |
412723 |
2.3 |
6.3 |
1000 |
MariaDB |
481342 |
2.1 |
4.21 |
2. 写请求(update)
并发 |
版本 |
qps |
平均响应时间(ms) |
99%响应时间(ms) |
50 |
开源 MySQL |
24816 |
2.37 |
2.82 |
50 |
MariaDB |
28925 |
2.33 |
2.55 |
100 |
开源 MySQL |
43046 |
2.25 |
3.91 |
100 |
MariaDB |
43466 |
2.3 |
4 |
200 |
开源 MySQL |
54690 |
3.92 |
7.86 |
200 |
MariaDB |
54045 |
3.7 |
7.27 |
500 |
开源 MySQL |
70192 |
7.44 |
14.1 |
500 |
MariaDB |
70370 |
7.25 |
15.52 |
1000 |
开源 MySQL |
68447 |
15.2 |
29.47 |
1000 |
MariaDB |
69890 |
14.35 |
30.73 |
3. 混合场景(OLTP 测试)
并发 |
版本 |
qps |
平均响应时间(ms) |
99%响应时间(ms) |
50 |
开源 MySQL |
154806 |
2.7 |
4.13 |
50 |
MariaDB |
162883 |
1.84 |
3.45 |
100 |
开源 MySQL |
162696 |
3.85 |
7.4 |
100 |
MariaDB |
173974 |
3.58 |
6.64 |
200 |
开源 MySQL |
204550 |
5.64 |
12.92 |
200 |
MariaDB |
208128 |
5.76 |
11.9 |
500 |
开源 MySQL |
235386 |
13.93 |
28.58 |
500 |
MariaDB |
232543 |
13.58 |
27.23 |
1000 |
开源 MySQL |
201765 |
28.29 |
60.72 |
1000 |
MariaDB |
226130 |
27.76 |
54.38 |