最近,将部分开发和测试环境的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

--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 linux内核_mysql 5.7.15 vs mysql 5.6.31性能测试以及不同linux内核性能比较相关推荐

  1. 编译 php mysql 依赖包_MySQL 5.5.15源码包编译安装

    mysql果然是不愧是目前最火的数据库,自从mysql5.5.8之后,mysql的源码包编译安装都要用到cmake来进行编译了,编译的过程没有本质 mysql果然是不愧是目前最火的数据库,自从mysq ...

  2. 电脑mysql 安装方法_mysql安装图解 windows安装mysql方法

    随着MYSQL版本的更新以及电脑系统的变化,我们给大家整理了各种电脑环境下安装MYSQL的图解过程,希望我们整理的内容能够帮助到大家: 编辑者:Vocabulary 下面详细介绍5.6版本MySQL的 ...

  3. 获取mysql可行方法_Mysql学习Java实现获得MySQL数据库中所有表的记录总数可行方法...

    <Mysql学习Java实现获得MySQL数据库中所有表的记录总数可行方法>要点: 本文介绍了Mysql学习Java实现获得MySQL数据库中所有表的记录总数可行方法,希望对您有用.如果有 ...

  4. mysql 删除原理_MySQL权限原理及删除MySQL的匿名账户

    MySQL权限系统的工作原理 MySQL权限系统通过下面两个阶段进行认证: (1)对连接的用户进行身份认证,合法的用户通过认证,不合法的用户拒绝连接: (2)对通过认证的合法用户赋予相应的权限,用户可 ...

  5. mysql in 有序_mysql中的in排序 mysql按in中顺序来排序

    假设,有如下的sql语句: 复制代码 代码示例: select * from table where id IN (3,6,9,1,2,5,8,7); 这样的情况取出来后,其实,id还是按1,2,3, ...

  6. mysql手机版_Mysql管理安卓版下载-Mysql管理appv1.4 最新版-腾牛安卓网

    Mysql管理app,手机上可以连接Mysql了.这是一个免费的数据库管理助手,数据表随时查看,使用Mysql也更加简单了哦,有需要的快来下载. Mysql管理: 一款小工具应用,手机上的Mysql连 ...

  7. mysql 关闭in自动排序,mysql排序语句_mysql中的in排序 mysql按in中顺序来排序

    摘要 腾兴网为您分享:mysql中的in排序 mysql按in中顺序来排序,易订货,虚拟按键,享家,顺丰小哥等软件知识,以及方正证券小方,音基100,dwg转dwf,酷狗游戏盒,聊天宝客服聊天,kin ...

  8. mysql资源教程_MySQL 超级入门教程以及MySQL 资源大全的分享

    MySQL简介 1.什么是数据库? 数据库(Database)是按照数据结构来组织.存储和管理数据的仓库,它产生于距今六十多年前,随着信息技术和市场的发展,特别是二十世纪九十年代以后,数据管理不再仅仅 ...

  9. mysql 定时任务 每月_mysql 定时任务 每月15号执行

    #查看当前是否已开启事件调度器 如果显示 on 证明已经开启 如果显示off 证明是关闭状态 show variables like 'event_scheduler'; #要想保证能够执行event ...

  10. mysql数据库问题解答_MySQL数据库常见错误问题解答 - MySQL 教程精选

    18.2.1MySQLserverhasgoneaway错误 本小节也涉及有关Lostconnectiontoserverduringquery的错误. 对MySQLserverhasgoneaway ...

最新文章

  1. MongoDB:mongodb在项目开发时的安全验证、分页查询操作
  2. 权重初始化方式对神经网络迭代次数的影响
  3. volatile能保持线程安全吗_从volatile说到i++的线程安全问题
  4. nacos dataid修改配置文件_nacos 配置中心自动化运维之namespace坑
  5. C语言和设计模式(之原型模式)
  6. lazarus 中文教程_Delphi 项目转Lazarus 教程
  7. Producter:让产品从0到1
  8. MAC使用青花瓷(charles)抓包
  9. java统计系统工具类
  10. 我的毕业生涯至从零开始从事编程开发
  11. iPad出现问题时,如何恢复出厂设置怎么操作?
  12. LBS与空间索引原理
  13. OSChina 周一乱弹 ——杜牧你个老流氓!
  14. 2022CPA财务成本管理-企业管理专题Corporate Goverance【完结】
  15. 驱动学习(十)poll机制
  16. Win 10 卡在登陆界面转圈
  17. 22 信息系统安全管理
  18. html标签360doc,360doc个人图书馆
  19. firefox网页自动翻译
  20. mail命令发送html格式的电子邮件

热门文章

  1. python, c/c++去掉文本的换行符
  2. C++ 调用 python
  3. unity中移动lindrender和transform, 两个点的位置
  4. xml 文件树结构用c++读入并保存
  5. Atitit aop的一些资料 目录 2. AOP(面向切面) 1 2.1.   切面(Aspect):其实就是共有功能的实现。如日志切面、权限切面、事务切面等 2 2.2.   通知(Advice
  6. Atitit 前端重要概念和趋势总结 大前端 目录 1. 大前端 1 2. 三个层面上的大前端 1 2.1. 大前端与NodeJS与前后端分离 1 2.2. 微信Web 1 2.3. React
  7. Atitit 安全规范 指南 常见五种意外防止规范 attilax总结
  8. Atitit. 数据约束 校验 原理理论与 架构设计 理念模式java php c#.net js javascript mysql oracle
  9. paip.网站提示SESSION过期 登录过期 以及二次登录的问题
  10. 阿里云眼中的“云网络3.0”:构建应用、云、边一体网络