热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

mysql4核_RDSMySQL5.74核和8核共享规格性能压测阿里云开发者社区

写在前面这次压测只用了一台ECS,也没有调整各种压测比和压测参数,把实例压到最高;这里的压测只是为了说明不同的参数对性能影响,

写在前面

这次压测只用了一台ECS,也没有调整各种压测比和压测参数,把实例压到最高;这里的压测只是为了说明不同的参数对性能影响,要想得出一个结论,必须要在可对比的情况下,比如:实例规格一样,从压测机到被压测机网络延迟一样,MySQL的配置文件一样等等,否则都是耍流氓。

压测环境

被压测的RDS实例规格

MySQL 5.7 物理机版 新规格8核32G

MySQL 5.7 物理机版 新规格4核16G

RDS主要参数配置

MySQL [(none)]> SHOW global VARIABLES WHERE Variable_name in ("sync_binlog","innodb_flush_log_at_trx_commit","rpl_semi_sync_slave_enabled","rpl_semi_sync_master_enabled","query_cache_type","have_query_cache");

+--------------------------------+-------+

| Variable_name | Value |

+--------------------------------+-------+

| have_query_cache | YES |

| innodb_flush_log_at_trx_commit | 1|2 |

| query_cache_type | OFF |

| rpl_semi_sync_master_enabled | ON|OFF |

| rpl_semi_sync_slave_enabled | OFF |

| sync_binlog | 1|1000 |

+--------------------------------+-------+

关于参数

网络延迟

从压测机ping RDS

64 bytes from *** (***): icmp_seq=1 ttl=64 time=1.69 ms

64 bytes from *** (***): icmp_seq=2 ttl=64 time=1.72 ms

64 bytes from *** (***): icmp_seq=3 ttl=64 time=1.72 ms

64 bytes from *** (***): icmp_seq=4 ttl=64 time=1.73 ms

64 bytes from *** (***): icmp_seq=5 ttl=64 time=1.73 ms

64 bytes from *** (***): icmp_seq=6 ttl=64 time=1.72 ms

64 bytes from *** (***): icmp_seq=7 ttl=64 time=1.73 ms

64 bytes from *** (***): icmp_seq=8 ttl=64 time=1.73 ms

64 bytes from *** (***): icmp_seq=9 ttl=64 time=1.72 ms

压测方法

sysbench /usr/share/sysbench/*** \

--mysql-host=*** \

--mysql-port=3306 \

--mysql-user=*** \

--mysql-password='***' \

--mysql-db=*** \

--db-driver=mysql \

--tables=10 \

--table-size=1000000 \

--report-interval=10 \

--threads=128 \

--time=120 prepare/run/cleanup

压测结果

8核32G 读写场景

双1

MySQL [(none)]> SHOW global VARIABLES WHERE Variable_name in ("sync_binlog","innodb_flush_log_at_trx_commit","rpl_semi_sync_slave_enabled","rpl_semi_sync_master_enabled","query_cache_type","have_query_cache");

+--------------------------------+-------+

| Variable_name | Value |

+--------------------------------+-------+

| have_query_cache | YES |

| innodb_flush_log_at_trx_commit | 1 |

| query_cache_type | OFF |

| rpl_semi_sync_master_enabled | ON |

| rpl_semi_sync_slave_enabled | OFF |

| sync_binlog | 1 |

+--------------------------------+-------+

6 rows in set (0.00 sec)

oltp_read_write.lua

SQL statistics:

transactions: 262843 (2187.92 per sec.)

queries: 5256860 (43758.44 per sec.)

General statistics:

total time: 120.1320s

total number of events: 262843

Latency (ms):

min: 20.91

avg: 58.45

max: 339.70

95th percentile: 86.00

sum: 15361894.55

# mysqlslap -a --concurrency=128 --number-of-queries 10000 --iterations=5 --engine=innodb --debug-info -u*** -p*** -h*** -P3306 --create-schema=***

Benchmark

Running for engine innodb

Average number of seconds to run all queries: 11.504 seconds

Minimum number of seconds to run all queries: 9.150 seconds

Maximum number of seconds to run all queries: 16.737 seconds

Number of clients running queries: 128

Average number of queries per client: 78

sync_binlog:1000和trx_commit=2

MySQL [(none)]> SHOW global VARIABLES WHERE Variable_name in ("sync_binlog","innodb_flush_log_at_trx_commit","rpl_semi_sync_slave_enabled","rpl_semi_sync_master_enabled","query_cache_type","have_query_cache");

+--------------------------------+-------+

| Variable_name | Value |

+--------------------------------+-------+

| have_query_cache | YES |

| innodb_flush_log_at_trx_commit | 2 |

| query_cache_type | OFF |

| rpl_semi_sync_master_enabled | OFF |

| rpl_semi_sync_slave_enabled | OFF |

| sync_binlog | 1000 |

+--------------------------------+-------+

6 rows in set (0.00 sec)

Threads started!

#oltp_read_write.lua

SQL statistics:

queries performed:

read: 3809666

write: 1088476

other: 544238

total: 5442380

transactions: 272119 (2266.76 per sec.)

queries: 5442380 (45335.11 per sec.)

General statistics:

total time: 120.0462s

total number of events: 272119

Latency (ms):

min: 20.08

avg: 56.45

max: 339.44

95th percentile: 84.47

sum: 15361371.70

# mysqlslap -a --concurrency=128 --number-of-queries 10000 --iterations=5 --engine=innodb --debug-info -u*** -p*** -h*** -P*** --create-schema=***

Benchmark

Running for engine innodb

Average number of seconds to run all queries: 9.238 seconds

Minimum number of seconds to run all queries: 8.394 seconds

Maximum number of seconds to run all queries: 9.624 seconds

Number of clients running queries: 128

Average number of queries per client: 78

只读场景

#oltp_point_select.lua

SQL statistics:

queries performed:

read: 11432749

write: 0

other: 0

total: 11432749

transactions: 11432749 (95255.06 per sec.)

queries: 11432749 (95255.06 per sec.)

General statistics:

total time: 120.0208s

total number of events: 11432749

Latency (ms):

min: 0.90

avg: 1.34

max: 18.23

95th percentile: 1.79

sum: 15351945.95

4核16G读写场景

双1

MySQL [(none)]> SHOW global VARIABLES WHERE Variable_name in ("sync_binlog","innodb_flush_log_at_trx_commit","rpl_semi_sync_slave_enabled","rpl_semi_sync_master_enabled","query_cache_type","have_query_cache");

+--------------------------------+-------+

| Variable_name | Value |

+--------------------------------+-------+

| have_query_cache | YES |

| innodb_flush_log_at_trx_commit | 1 |

| query_cache_type | OFF |

| rpl_semi_sync_master_enabled | ON |

| rpl_semi_sync_slave_enabled | OFF |

| sync_binlog | 1 |

+--------------------------------+-------+

oltp_read_write.lua

SQL statistics:

queries performed:

read: 1643950

write: 469700

other: 234850

total: 2348500

transactions: 117425 (977.46 per sec.)

queries: 2348500 (19549.17 per sec.)

General statistics:

total time: 120.1314s

total number of events: 117425

Latency (ms):

min: 28.19

avg: 130.88

max: 446.28

95th percentile: 155.80

sum: 15368416.16

# mysqlslap -a --concurrency=128 --number-of-queries 10000 --iterations=5 --engine=innodb --debug-info -u*** -p*** -h*** -P3306 --create-schema=***

Benchmark

Running for engine innodb

Average number of seconds to run all queries: 12.546 seconds

Minimum number of seconds to run all queries: 12.445 seconds

Maximum number of seconds to run all queries: 12.657 seconds

Number of clients running queries: 128

Average number of queries per client: 78

sync_binlog:1000和trx_commit=2

mysql> SHOW global VARIABLES WHERE Variable_name in ("sync_binlog","innodb_flush_log_at_trx_commit","rpl_semi_sync_slave_enabled","rpl_semi_sync_master_enabled","query_cache_type","have_query_cache");

+--------------------------------+-------+

| Variable_name | Value |

+--------------------------------+-------+

| have_query_cache | YES |

| innodb_flush_log_at_trx_commit | 2 |

| query_cache_type | OFF |

| rpl_semi_sync_master_enabled | OFF |

| rpl_semi_sync_slave_enabled | OFF |

| sync_binlog | 1000 |

+--------------------------------+-------+

oltp_read_write.lua

SQL statistics:

queries performed:

read: 1650866

write: 471676

other: 235838

total: 2358380

transactions: 117919 (981.66 per sec.)

queries: 2358380 (19633.27 per sec.)

General statistics:

total time: 120.1198s

total number of events: 117919

Latency (ms):

min: 21.31

avg: 130.32

max: 439.36

95th percentile: 155.80

sum: 15366638.87

只读场景

oltp_point_select.lua

SQL statistics:

queries performed:

read: 4924841

write: 0

other: 0

total: 4924841

transactions: 4924841 (41031.29 per sec.)

queries: 4924841 (41031.29 per sec.)

General statistics:

total time: 120.0248s

total number of events: 4924841

Latency (ms):

min: 0.90

avg: 3.12

max: 65.22

95th percentile: 28.16

sum: 15356974.94

性能对比图

cf8a492117bd9807baff64d8383f34ae.png

0d77f4bcc60370f0f061f0fdfa99f88d.png



推荐阅读
  • 单目标应用:最有价值球员算法(Most Valuable Player Algorithm,MVPA)求解旅行商问题TSP
    一、最有价值球员算法最有价值球员算法(MostValuablePlayerAlgorithm,MVPA)由Bouchekara等人于20 ... [详细]
  • 本文详细介绍了如何使用MySQL来显示SQL语句的执行时间,并通过MySQL Query Profiler获取CPU和内存使用量以及系统锁和表锁的时间。同时介绍了效能分析的三种方法:瓶颈分析、工作负载分析和基于比率的分析。 ... [详细]
  • 图解redis的持久化存储机制RDB和AOF的原理和优缺点
    本文通过图解的方式介绍了redis的持久化存储机制RDB和AOF的原理和优缺点。RDB是将redis内存中的数据保存为快照文件,恢复速度较快但不支持拉链式快照。AOF是将操作日志保存到磁盘,实时存储数据但恢复速度较慢。文章详细分析了两种机制的优缺点,帮助读者更好地理解redis的持久化存储策略。 ... [详细]
  • 本文介绍了Android 7的学习笔记总结,包括最新的移动架构视频、大厂安卓面试真题和项目实战源码讲义。同时还分享了开源的完整内容,并提醒读者在使用FileProvider适配时要注意不同模块的AndroidManfiest.xml中配置的xml文件名必须不同,否则会出现问题。 ... [详细]
  • Oracle seg,V$TEMPSEG_USAGE与Oracle排序的关系及使用方法
    本文介绍了Oracle seg,V$TEMPSEG_USAGE与Oracle排序之间的关系,V$TEMPSEG_USAGE是V_$SORT_USAGE的同义词,通过查询dba_objects和dba_synonyms视图可以了解到它们的详细信息。同时,还探讨了V$TEMPSEG_USAGE的使用方法。 ... [详细]
  • 本文讨论了在openwrt-17.01版本中,mt7628设备上初始化启动时eth0的mac地址总是随机生成的问题。每次随机生成的eth0的mac地址都会写到/sys/class/net/eth0/address目录下,而openwrt-17.01原版的SDK会根据随机生成的eth0的mac地址再生成eth0.1、eth0.2等,生成后的mac地址会保存在/etc/config/network下。 ... [详细]
  • 本文介绍了如何使用PHP代码将表格导出为UTF8格式的Excel文件。首先,需要连接到数据库并获取表格的列名。然后,设置文件名和文件指针,并将内容写入文件。最后,设置响应头部,将文件作为附件下载。 ... [详细]
  • 本文介绍了5个基本Linux命令行工具的现代化替代品,包括du、top和ncdu。这些替代品在功能上进行了改进,提高了可用性,并且适用于现代化系统。其中,ncdu是du的替代品,它提供了与du类似的结果,但在一个基于curses的交互式界面中,重点关注占用磁盘空间较多的目录。 ... [详细]
  • Spring框架《一》简介
    Spring框架《一》1.Spring概述1.1简介1.2Spring模板二、IOC容器和Bean1.IOC和DI简介2.三种通过类型获取bean3.给bean的属性赋值3.1依赖 ... [详细]
  • php缓存ri,浅析ThinkPHP缓存之快速缓存(F方法)和动态缓存(S方法)(日常整理)
    thinkPHP的F方法只能用于缓存简单数据类型,不支持有效期和缓存对象。S()缓存方法支持有效期,又称动态缓存方法。本文是小编日常整理有关thinkp ... [详细]
  • 本文介绍了在Ubuntu系统中清理残余配置文件和无用内容的方法,包括清理残余配置文件、清理下载缓存包、清理不再需要的包、清理无用的语言文件和清理无用的翻译内容。通过这些清理操作可以节省硬盘空间,提高系统的运行效率。 ... [详细]
  • 程序员如何选择机械键盘轴体?红轴和茶轴对比
    本文介绍了程序员如何选择机械键盘轴体,特别是红轴和茶轴的对比。同时还介绍了U盘安装Linux镜像的步骤,以及在Linux系统中安装软件的命令行操作。此外,还介绍了nodejs和npm的安装方法,以及在VSCode中安装和配置常用插件的方法。最后,还介绍了如何在GitHub上配置SSH密钥和git的基本配置。 ... [详细]
  • 概述本章主要写当慢查询文件很大的时候怎样在线生成一个新的慢查询文件。测试环境:mysql5.6.2 ... [详细]
  • Openresty+Lua+Redis灰度发布
    Openresty+Lua+Redis灰度发布灰度发布,简单来说,就是根据各种条件,让一部分用户使用旧版本,另一部分用户使用新版本。百度百科中解释:灰度发布是指在黑与白之间,能够平 ... [详细]
  • 整整的花了一个下午的时候,才在lua中调用了动态链接库。比起其他脚本语言,lua的调用方式算是比较繁琐的,但是lua的编程思想非常的统一& ... [详细]
author-avatar
山寨西域刀羊_281
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有