MySQL 5.7 vs 8.0版本的性能有什么区别

  介绍

这篇文章主要介绍MySQL 5.7 vs 8.0版本的性能有什么区别,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

背景

测试mysql5.7和mysql8.0分别在读写,只读,只写模式下不同并发时的性能(tps,每秒)

前提
    <李>测试使用版本为mysql5.7.22和mysql8.0.15李 <>李sysbench测试前先重启MySQL服务,并清空操作系统的缓存(避免多次测试时命中缓存) <李>每次进行测试都是新生成测试数据后再进行mysql5.7和mysql8.0的测试李 <李>每次测试时保证mysql5.7和mysql8.0的配置参数一致李
环境

机器

猫/etc/redhat-release | xargs回声& # 39;版本& # 39;,,dmidecode - s system-product-name | xargs回声& # 39;是否虚拟化& # 39;,,猫/proc/cpuinfo | grep“processor" | wc - l | xargs回声& # 39;cpu核数& # 39;   Linux发行版本CentOS 7.5.1804(核心)   KVM是否虚拟化   cpu核数4复制代码

myql5.7.22

5.7.22-log   通过innodb_buffer_pool_size 128   innodb_log_buffer_size 64   innodb_log_file_size 48米   binlog_format行   log_bin> 8.0.15   通过innodb_buffer_pool_size 128   innodb_log_buffer_size 64   innodb_log_file_size 48米   binlog_format行   log_bin> sysbench - v   sysbench 1.1.0(使用捆绑LuaJIT 2.1.0-beta3)复制代码
测试
    <李>

    在不同的持久化策略下(binlog,重做日志持久化)mysql5.7和mysql8.0在读写模式,只读模式,只写模式(oltp_read_write、oltp_read_only oltp_write_only)下的性能表现

    <李>

    sysbench测试时间为60年代,测试的表数量为20

    <李>

    测试分别在双1模式(安全性)和0 2模式(高性能)下进行%20

    %20%20<李>%20

    %20

    显示全球,变量在Variable_name (& # 39; sync_binlog& # 39; & # 39; innodb_flush_log_at_trx_commit& # 39;);   + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +   | Variable_name,,,,,,,,| |值   + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +   | innodb_flush_log_at_trx_commit | 1,,|   | sync_binlog,,,,,,,,,| 1大敌;|   + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +

mysql5.7和mysql8.0在读写模式下的表现%20

%20

%20

    <李>双1配置,读写模式下,mysql5.7.22和mysql8.0.15 tps,每秒性能差不多,mysql8.0.15在120线程并发时,性能出现了下降抖动:

mysql5.7和mysql8.0在只读模式下的表现

 MySQL 5.7 vs 8.0版本的性能有什么区别

    <李>双1配置,只读模式下,mysql5.7.22 tps的,每秒比mysql8.0.15好1/3左右,并发线程数增加后,tps,每秒并没有随着增加,反而出现了下降的趋势。

mysql5.7和mysql8.0在只写模式下的表现%20

%20

%20

    <李>双1配置,只写模式下,随着并发数的上升,mysql5.7.22的性能比mysql8.0.15好1/4左右。

0 2模式下

显示全局变量在Variable_name (& # 39; sync_binlog& # 39; & # 39; innodb_flush_log_at_trx_commit& # 39;);   + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +   | | Variable_name |值   + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +   | innodb_flush_log_at_trx_commit | 2 |   | sync_binlog | 0 |   + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +复制代码

mysql5.7和mysql8.0在读写模式下的表现%20

MySQL 5.7 vs 8.0版本的性能有什么区别