最近,将部分开发和测试环境的mysql升级到5.7之后,今天抽时间测试了下5.6和5.7 PK查询的性能,使用mysqlslap进行测试,测试结果发现在低配下,percona 5.6.31大约比5.7.15快20-30%左右,percona 5.7.15比mysql企业版5.7.16快10%左右,如下:

--mysql企业版

mysqlslap -h172.18.30.62 -P3306 --concurrency=200 --create-schema='spider' --query='select * from test_250byte where id=1;' --number-of-queries=1000000 -uroot -p123456
mysqlslap: [Warning] Using a password on the command line interface can be insecure.
Benchmark
Average number of seconds to run all queries: 72.719 seconds
Minimum number of seconds to run all queries: 72.719 seconds
Maximum number of seconds to run all queries: 72.719 seconds
Number of clients running queries: 200
Average number of queries per client: 5000

--percona 5.7.15

[root@dev-server1 ~]# mysqlslap -h172.18.30.62 -P3306 --concurrency=200 --create-schema='spider' --query='select * from test_250byte where id=1;' --number-of-queries=1000000 -uroot -p123456
mysqlslap: [Warning] Using a password on the command line interface can be insecure.
Benchmark
Average number of seconds to run all queries: 66.628 seconds
Minimum number of seconds to run all queries: 66.628 seconds
Maximum number of seconds to run all queries: 66.628 seconds
Number of clients running queries: 200
Average number of queries per client: 5000

[root@dev-server1 ~]# mysqlslap -h172.18.30.62 -P3306 --concurrency=200 --create-schema='spider' --query='select * from test_250byte where id=1;' --number-of-queries=1000000 -uroot -p123456
mysqlslap: [Warning] Using a password on the command line interface can be insecure.
Benchmark
Average number of seconds to run all queries: 66.278 seconds
Minimum number of seconds to run all queries: 66.278 seconds
Maximum number of seconds to run all queries: 66.278 seconds
Number of clients running queries: 200
Average number of queries per client: 5000

--percona 5.6.31

[root@dev-server1 ~]# mysqlslap -h172.18.30.62 -P3306 --concurrency=200 --create-schema='spider' --query='select * from test_250byte where id=1;' --number-of-queries=1000000 -uroot -p123456
mysqlslap: [Warning] Using a password on the command line interface can be insecure.
Benchmark
Average number of seconds to run all queries: 55.878 seconds
Minimum number of seconds to run all queries: 55.878 seconds
Maximum number of seconds to run all queries: 55.878 seconds
Number of clients running queries: 200
Average number of queries per client: 5000

[root@dev-server1 ~]# mysqlslap -h172.18.30.62 -P3306 --concurrency=200 --create-schema='spider' --query='select * from test_250byte where id=1;' --number-of-queries=1000000 -uroot -p123456
mysqlslap: [Warning] Using a password on the command line interface can be insecure.
Benchmark
Average number of seconds to run all queries: 57.169 seconds
Minimum number of seconds to run all queries: 57.169 seconds
Maximum number of seconds to run all queries: 57.169 seconds
Number of clients running queries: 200
Average number of queries per client: 5000

[root@dev-server1 ~]# mysqlslap -h172.18.30.62 -P3306 --concurrency=200 --create-schema='spider' --query='select * from test_250byte where id=1;' --number-of-queries=1000000 -uroot -p123456
mysqlslap: [Warning] Using a password on the command line interface can be insecure.
Benchmark
Average number of seconds to run all queries: 51.820 seconds
Minimum number of seconds to run all queries: 51.820 seconds
Maximum number of seconds to run all queries: 51.820 seconds
Number of clients running queries: 200
Average number of queries per client: 5000

[root@dev-server1 ~]# mysqlslap -h172.18.30.62 -P3306 --concurrency=200 --create-schema='spider' --query='select * from test_250byte where id=1;' --number-of-queries=1000000 -uroot -p123456
mysqlslap: [Warning] Using a password on the command line interface can be insecure.
Benchmark
Average number of seconds to run all queries: 52.817 seconds
Minimum number of seconds to run all queries: 52.817 seconds
Maximum number of seconds to run all queries: 52.817 seconds
Number of clients running queries: 200
Average number of queries per client: 5000

因为mysql 5.7相比mysql 5.6增加了很多新的特性、同时新增了很多后台线程,所以在达到mysql 5.6的最大并发之前,mysql 5.6在性能上比mysql 5.7更高并不奇怪。因为我们大量服务器部署于阿里云和虚拟化环境,所以不打算也不计划测试在64GB以上的环境。后续会测试在16C/16GB和16C/32GB环境下两者的情况。

上述测试基于centos 7.2,linux内核3.10。

同时,需要注意的是,在不同的vm实例中,即使配置和型号完全相同,也有可能出现TPS上下相差10-20%的情况,这一点尤其需要注意,因为任何时候cpu/内存/服务器进程/线程等都可能在不同程度的运行,即使是空环境亦如此。另外,还需要注意不同的linux/内核版本可能导致性能相差比较大。

在另一个centos 6.3,内核2.6.32的VM实例中,percona 5.6.31的测试如下(平均TPS达到22000)(7.0相同配置下平均18000左右):

[root@dev-server1 ~]# mysqlslap -h172.18.30.193 -P3306 --concurrency=200 --create-schema='spider' --query='select * from test_250byte where id=1;' --number-of-queries=1000000 -uroot -pLd123123
mysqlslap: [Warning] Using a password on the command line interface can be insecure.
Benchmark
Average number of seconds to run all queries: 42.936 seconds
Minimum number of seconds to run all queries: 42.936 seconds
Maximum number of seconds to run all queries: 42.936 seconds
Number of clients running queries: 200
Average number of queries per client: 5000

[root@dev-server1 ~]# mysqlslap -h172.18.30.193 -P3306 --concurrency=200 --create-schema='spider' --query='select * from test_250byte where id=1;' --number-of-queries=1000000 -uroot -pLd123123
mysqlslap: [Warning] Using a password on the command line interface can be insecure.
Benchmark
Average number of seconds to run all queries: 43.359 seconds
Minimum number of seconds to run all queries: 43.359 seconds
Maximum number of seconds to run all queries: 43.359 seconds
Number of clients running queries: 200
Average number of queries per client: 5000

[root@dev-server1 ~]# mysqlslap -h172.18.30.193 -P3306 --concurrency=200 --create-schema='spider' --query='select * from test_250byte where id=1;' --number-of-queries=1000000 -uroot -pLd123123
mysqlslap: [Warning] Using a password on the command line interface can be insecure.
Benchmark
Average number of seconds to run all queries: 47.033 seconds
Minimum number of seconds to run all queries: 47.033 seconds
Maximum number of seconds to run all queries: 47.033 seconds
Number of clients running queries: 200
Average number of queries per client: 5000

------------晚上临时找了两个环境,测试了下centos 6.5 8C/16GB阿里云下,如下-------------------

percona 5.7.15

[root@iZbp11t4fzcyfwa9k5eb77Z ~]# mysqlslap -hXXX -P3306 --concurrency=200 --create-schema='spider' --query='select * from test_250byte where id=1;' --number-of-queries=1000000 -uroot -p123456
Warning: Using a password on the command line interface can be insecure.
Benchmark
Average number of seconds to run all queries: 28.632 seconds
Minimum number of seconds to run all queries: 28.632 seconds
Maximum number of seconds to run all queries: 28.632 seconds
Number of clients running queries: 200
Average number of queries per client: 5000

[root@iZbp11t4fzcyfwa9k5eb77Z ~]# mysqlslap -hXXX -P3306 --concurrency=400 --create-schema='spider' --query='select * from test_250byte where id=1;' --number-of-queries=1000000 -uroot -p123456
Warning: Using a password on the command line interface can be insecure.
Benchmark
Average number of seconds to run all queries: 26.167 seconds
Minimum number of seconds to run all queries: 26.167 seconds
Maximum number of seconds to run all queries: 26.167 seconds
Number of clients running queries: 400
Average number of queries per client: 2500

[root@iZbp11t4fzcyfwa9k5eb77Z ~]# 2016-11-10T11:37:06.099118Z mysqld_safe mysqld from pid file /usr/local/Percona-Server-5.7.15-9-Linux.x86_64.ssl101/data/iZbp14bngbtxcrrha173qvZ.pid ended

[root@iZbp11t4fzcyfwa9k5eb77Z ~]#
[root@iZbp11t4fzcyfwa9k5eb77Z ~]#
[root@iZbp11t4fzcyfwa9k5eb77Z ~]#
[root@iZbp11t4fzcyfwa9k5eb77Z ~]# mysqlslap -hXXX -P3306 --concurrency=400 --create-schema='spider' --query='select * from test_250byte where id=1;' --number-of-queries=1000000 -uroot -p123456
Warning: Using a password on the command line interface can be insecure.
Benchmark
Average number of seconds to run all queries: 26.266 seconds
Minimum number of seconds to run all queries: 26.266 seconds
Maximum number of seconds to run all queries: 26.266 seconds
Number of clients running queries: 400
Average number of queries per client: 2500

[root@iZbp11t4fzcyfwa9k5eb77Z ~]#
[root@iZbp11t4fzcyfwa9k5eb77Z ~]#
[root@iZbp11t4fzcyfwa9k5eb77Z ~]#
[root@iZbp11t4fzcyfwa9k5eb77Z ~]# mysqlslap -hXXX -P3306 --concurrency=400 --create-schema='spider' --query='select * from test_250byte where id=1;' --number-of-queries=1000000 -uroot -p123456
Warning: Using a password on the command line interface can be insecure.
Benchmark
Average number of seconds to run all queries: 25.370 seconds
Minimum number of seconds to run all queries: 25.370 seconds
Maximum number of seconds to run all queries: 25.370 seconds
Number of clients running queries: 400
Average number of queries per client: 2500

[root@iZbp11t4fzcyfwa9k5eb77Z ~]#
[root@iZbp11t4fzcyfwa9k5eb77Z ~]#
[root@iZbp11t4fzcyfwa9k5eb77Z ~]# mysqlslap -hXXX -P3306 --concurrency=600 --create-schema='spider' --query='select * from test_250byte where id=1;' --number-of-queries=1000000 -uroot -p123456
Warning: Using a password on the command line interface can be insecure.
Benchmark
Average number of seconds to run all queries: 24.399 seconds
Minimum number of seconds to run all queries: 24.399 seconds
Maximum number of seconds to run all queries: 24.399 seconds
Number of clients running queries: 600
Average number of queries per client: 1666

=====================

percona 5.6.31

[root@iZbp11t4fzcyfwa9k5eb77Z ~]# mysqlslap -hXXX -P3306 --concurrency=200 --create-schema='spider' --query='select * from test_250byte where id=1;' --number-of-queries=1000000 -uroot -p123456
Warning: Using a password on the command line interface can be insecure.
Benchmark
Average number of seconds to run all queries: 29.882 seconds
Minimum number of seconds to run all queries: 29.882 seconds
Maximum number of seconds to run all queries: 29.882 seconds
Number of clients running queries: 200
Average number of queries per client: 5000

[root@iZbp11t4fzcyfwa9k5eb77Z ~]# mysqlslap -hXXX -P3306 --concurrency=400 --create-schema='spider' --query='select * from test_250byte where id=1;' --number-of-queries=1000000 -uroot -p123456
Warning: Using a password on the command line interface can be insecure.
Benchmark
Average number of seconds to run all queries: 25.210 seconds
Minimum number of seconds to run all queries: 25.210 seconds
Maximum number of seconds to run all queries: 25.210 seconds
Number of clients running queries: 400
Average number of queries per client: 2500

[root@iZbp11t4fzcyfwa9k5eb77Z ~]# mysqlslap -hXXX -P3306 --concurrency=400 --create-schema='spider' --query='select * from test_250byte where id=1;' --number-of-queries=1000000 -uroot -p123456
Warning: Using a password on the command line interface can be insecure.
Benchmark
Average number of seconds to run all queries: 26.084 seconds
Minimum number of seconds to run all queries: 26.084 seconds
Maximum number of seconds to run all queries: 26.084 seconds
Number of clients running queries: 400
Average number of queries per client: 2500

[root@iZbp11t4fzcyfwa9k5eb77Z ~]# mysqlslap -hXXX -P3306 --concurrency=600 --create-schema='spider' --query='select * from test_250byte where id=1;' --number-of-queries=1000000 -uroot -p123456
Warning: Using a password on the command line interface can be insecure.
Benchmark
Average number of seconds to run all queries: 24.896 seconds
Minimum number of seconds to run all queries: 24.896 seconds
Maximum number of seconds to run all queries: 24.896 seconds
Number of clients running queries: 600
Average number of queries per client: 1666

基本上可以看出,在8C的配置下,mysql 5.6和5.7的性能已经比较接近的,按说配置再增加的情况下,5.7的扩展性会比5.6更好,且新增的很多额外线程的消耗会被抵销。

mysql 5.7.15 vs mysql 5.6.31性能测试以及不同linux内核性能比较的更多相关文章

  1. [MySQL Reference Manual]15. 其他存储引擎

    15. 其他存储引擎 15. 其他存储引擎 15.1 设置存储引擎 15.2 MyISAM存储引擎 15.2.1 MyISAM启动选项 15.2.2 Key的空间要求 15.2.3 MyISAM表存储 ...

  2. PowerDesigner 15设置mysql主键自动增长及基数

    PowerDesigner 15设置mysql主键自动增长及基数 1.双击标示图,打开table properties->columns,  如图点击图标Customize Columns an ...

  3. mysql 5.7.15单机主从快速搭建并配置复制表到不同库

    一直以来因为线上系统盘中风控计算过于消耗资源,导致服务器负载太高,时常影响盘中交易的稳定性,最近决定了将风控拆分到独立的库进行计算,并进行回填操作. 总体来说,是将部分风控计算相关的表同步到备库,但是 ...

  4. Delphi 7连接MySql 5.5.15

    原文:http://blog.csdn.net/akof1314/article/details/6822902/ 网上有很多关于Delphi连接MySql数据库的文章,在这里,我只记录下自己测试过的 ...

  5. Centos 6.4上面用Shell脚本一键安装mysql 5.6.15

    Centos 6.4上面用Shell脚本一键安装mysql 5.6.15  #!/bin/bash if [ `uname -m` == "x86_64" ];then machi ...

  6. LNMP搭建(CentOS 6.3+Nginx 1.2.0+PHP 5.3.15(fpm)+ MySQL 5.5.35)

    Nginx (“engine x”) 是一个高性能的 HTTP 和反向代理服务器,也是一个 IMAP/POP3/SMTP 代理服务器. Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 ...

  7. mysql查超过15分钟未付款的订单,更新为失效状态

    个人打开自己的订单时,才检查超过15分钟未付款的订单, 暂不使用机器人,更新状态, Difference counter 差分计数器订单超过15分钟.mysql的时间戳差分比较 $sql =  TIM ...

  8. Delphi 7连接MySql 5.5.15(转)

    网上有很多关于Delphi连接MySql数据库的文章,在这里,我只记录下自己测试过的方法,以备所需.系统环境:Windows XP SP3软件环境:Delphi 7 .mysql-installer- ...

  9. (3.15)mysql基础深入——mysql默认数据库/系统数据库

    (3.15)mysql基础深入——mysql默认数据库 关键词:Mysql默认数据库,mysql系统数据库 系统数据库的组成 一共4个 [1]information_schema(可以理解成字典表) ...

随机推荐

  1. 彻底理解跨域解决方案JSONP

    什么是同源策略? 同源策略,它是由Netscape提出的一个著名的安全策略.现在所有支持JavaScript 的浏览器都会使用这个策略. 所谓同源是指,域名,协议,端口相同.当一个浏览器的两个tab页 ...

  2. 记一次裸迁 MySQL 经历

    记一次裸迁MySQL经历 前言:博主企业有一台企业阿里云机器,因为安装了云锁,造成服务器动不动就给我所死服务器.(就是那种 chattr +i /bin/bash ,分分钟日死狗 )趁着周末,Boos ...

  3. ligerUI Tree 实例 代码

    http://www.oschina.net/code/snippet_1762525_47819#68813

  4. hdu3635 Dragon Balls(带权并查集)

    /* 题意:有N个城市, 每一个城市都有一个龙珠(编号与城市的编号相同),有两个操作 T A ,B 将标号为A龙珠所在城市的所有的龙珠移动到B龙珠所在城市中! 思路:并查集 (压缩路径的时候将龙珠移动 ...

  5. JavaScript面向对象程序设计:数组

    或许你会奇怪,面向对象的程序设计为什么从数组开始讲起?这是因为……其间的种种关系吧……嘿嘿,这里先卖个关子,先来看看我们熟悉的数组在JavaScript里面是什么样子的.   1. 创建数组   在J ...

  6. vs2010快捷键

    vs的快捷键包含部分代码的自动生成 VS2010 快捷键 全屏:Shift+Alt+Enter 注释选定内容:Ctrl+E+C/Crtr+E+U 代码格式化:ctrl+E+F VS2008 使用小技巧 ...

  7. html中获取图片的真实尺寸

    使用js得到图片的真实尺寸,下面就是js代码: <html> <head> <script type="text/javascript" src=&q ...

  8. 11款扁平化设计的 Twitter Bootstrap 主题和模板

    扁平化设计和 Bootstrap 框架是2013年网页设计领域的两大设计潮流.把这两者集合起来不是件容易的事情,使用下面这些主题和模板将节省我们的开发时间,因为我们可以修改已有的基础代码,而不是从零开 ...

  9. 转[开发环境配置]在Ubuntu下配置舒服的Python开发环境

    在Ubuntu下配置舒服的Python开发环境 Ubuntu 提供了一个良好的 Python 开发环境,但如果想使我们的开发效率最大化,还需要进行很多定制化的安装和配置.下面的是我们团队开发人员推荐的 ...

  10. 关于IE6中做兼容的那点事。

    前言 对于程序员来说,一听到你做的程序必须兼容IE6(当然主流浏览器肯定得兼容的),那颗滚烫的心瞬间哇凉哇凉的,但是有时,项目就要求这样,你也只能硬着头皮跟IE6来个亲密接触,最近正好做了个项目,关于 ...