<MySQL Performance: over 1M QPS with InnoDB Memcached Plugin in MySQL 5.7>MySQL的高性能:MySQL 5.7

在Percona Live Conference中,MySQL 5.7的InnoDB Memcached插件实现了每秒100万次查询的性能突破。此成果得益于近期MySQL 5.7的整体加速及Facebook团队提供的性能挑战案例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

MySQL Performance: over 1M QPS with InnoDB Memcached Plugin in MySQL 5.7


Last week, during Tomas' keynote at MySQL Percona Live Conference in London we announced as one of "previews" of the following MySQL 5.7 release(s) -- an over 1,000,000 Query/sec result obtained with InnoDB Memcached plugin on a Read-Only workload. This article here is just to confirm the announced results without going too much in details..

在上周, Tomas 在 MySQL Percona Live Conference in London ,宣布了MySQL 5.7的版本--在只读的(Read-Only)测试环境,InnoDB 的 Memcached plugin的版本中,可以处理 每秒 1,000,000 次的查询。这个文章就是证实这个说法的。


In fact we have no idea yet for today what are exactly the scalability and performance limits for this solution.. The huge gain in performance was possible here due initial overall speed-up made recently in MySQL 5.7 and letting us reach 500K QPS in a "normal" SQL Read-Only workload. Then yet more improvement in the InnoDB Memcached Plugin code were possible and came just naturally. Specially since Facebook Team challenged us here pretty well by expressing all performance limitations they are hitting in their workloads. As well Facebook provided us a test case workload which we successfully used to improve even more our code. And finally the same test case was used to obtain the following benchmark results ;-)

实际上,我至今也没有准确说法,到底可拓展性有多么的准确和有多少的性能限制在这里面..我们可以在最新的MySQL 5.7 中可以得到最大的性能提升,并且,并且可以让我们轻松的在“普通的”(normal)SQL 在只读的环境中(Read-Only workload)  测试到 500K QPS 。接下来,更多的性能提升在InnoDB Memcached Plugin代码中变为可能,然而,一切都是那么自然。尤其在Facebook团队,他们突破并展现出巨大的性能点。当然,Facebook给我们提供了一个测试case,我们也用它来成功的提高了我们代码。最终,同样的测试案例会在下面的测试评分结果中展示出来;-)

The test was executed in "standalone" mode (both server and client are running on the same server). So, we used our biggest HW box we have in the LAB - a 48cores machine. This server was able very quickly to point us into any existing or potential performance issues and bottlenecks (and what is interesting that most of them were now on the memcached code itself). However, Query/sec rate (QPS) is depending a lot here of memory latency and CPU frequency, while this server is having 2Ghz CPU cores only, so on a faster HW you may expect even better results ;-)


这个测试是在”独立“(standalone)模式上测试的。(包括服务器,客户端都在上面运行)。所以,我们使用我们实验室最大的HW box - 一个48核的机器。这个服务器能够迅速的给我们指出一个存在的,或者潜在的性能瓶颈(最有趣的是,大部分他们都是在memcached代码上面)。然而,QPS 依赖于内存和CPU。因此,这台服务器是只有2Ghz的CPU 核,如果有存在其他更快的HW,你可能能得到更好的积分统计 :-)
Now, comparing best-to-best QPS results obtained on this server we have the following :


and for people who prefer 2D charts :

大家更喜欢这种2D的表格统计:


 
I've placed in legend "MySQL 5.6", while a true label should be rather "the best result we observed until now" ;-)) -- because some part of Memcached code improvement will be back-ported to MySQL 5.6 as well, so we may expect to see next 5.6 releases running here better too. However - only with MySQL 5.7 code base you'll be able to go really high..


我还是把”MySQL 5.6“标记成一个传奇,这是理所当然的”那是我保存的最好的结果,直到现在“;-)因为一些Memcached code 也移植到MySQL 5.6,所以,我们也期望在下一个5.6的版本中也能跑到这么高的分数。然而,只有MySQL 5.7才可以跑到这么高的分数。

During my talk at Percona Live in London I've also presented the following graphs - the Memcached QPS is corresponding here to the InnoDB "dml_reads/sec" stats :

在我在 Percona Live in London 对话中,我依然保留了下图-Memcached QPS 这这里对应InnoDB的“dml_reads/sec" 

There are 4 tests on these graphs representing "previous" MySQL code running on Memcached workload :

这这图标中,这有4个测试。”先前的“MySQL代码运行在Memcached 工作区中:

  • #1 - running on 48cores as it.. - we're hitting a severe contentions related to the MVCC code (which was fixed in the latest MySQL 5.7)..
  • #1 - 也运行在48核的机器上面 .. - 我们得到了少数的竞争,基于MVCC。(我们在5.7中得到修复)
  • #2 - limiting MySQL server to run on 16cores only to lower this contention.. - and then hitting transaction related contentions (which was also fixed in the latest MySQL 5.7 code)..
  • #2 - 限制MySQL服务器跑在16核的机子上面,降低竞争。。--然而,得到更少的事务之间的竞争(我们也在5.7中得到修复)
  • #3 - tune memcached plugin to keep several reads within a single internal transaction -- helps, but hitting other contentions..
  • #3 - 打开Memcached plugin 来保证在单个间隔事务中读,--有帮助-确实没有资源争用
  • #4 - limiting MySQL server to run on 8cores to see if contentions may be lowered -- indeed, the max peak QPS becomes higher (on 32 users), but overall performance is worse..
  • #4 - 限制MySQL 服务器跑在8核的机器上,去看看竞争是否可能会降低 -- 确实,最大的peak QPS变得更高(32个用户),但是负载更为严重。


While on the latest MySQL 5.7 code things are looking completely differently :

而在最新的MySQL 5.7的事情看起来完全不同:


There are 2 tests on these graphs:

在这图标中,有两个测试:

  • #1 - is running on 48cores as it (no comments ;-))
  • #1 - 跑在48核上面(没有评论;-)
  • #2 - is using "tuning" option to keep several reads within a single internal transaction - just slightly better on a peak max QPS, otherwise no significant difference anymore..
  • #2 - 用”打开“(tuning)选项去保持单一间隔事务的少量读-稍微在QPS高峰期最好,否则,就没有显著的差异了


And to really feel the difference in obtained QPS gap, let's bring them all together to the same graph :

感受一下增加QPS gap的不同,我把他们放在一个图表中。


As you can see, the difference is more than impressive ;-))

不同点会更见让你印象深刻:-)

  • all the curves on the left parts of graph representing QPS levels obtained on the "previous" MySQL 5.6 / 5.7 code..
  • 左边的曲线是先前的MySQL 5.6/5.7 
  • then, the last curves on the right part - with the latest MySQL 5.7 code..
  • 最后一个曲线(右边)是MySQL 5.7的最新版本


So, work is still in progress, and I let Sunny and Jimmy provide you all deep details about this huge step forward we made in the latest MySQL 5.7 release!

所以,工作测试还要继续,我让Sunny和Jimmy 给你提供更为详细的步骤在最新的MySQL 5.7版本中!


I don't know what will be the performance limit here.. Probably only HW level.. And don't know if we'll have a big enough HW to see it ;-) -- currently via a single 1Gbit network link we already observed over 700K QPS performance, and while the limitation is coming here from a single network link, the main troubles are coming from clients processing rather server.. - so, seems like Memcached @InnoDB is scaling now way better comparing to the "original" Memcached itself ;-) -- then, what kind of performance may be expected when several network links are used (or simply more fast network cards are used) -- there is still a lot to discover! and RW workload performance will be yet another challenge as well ;-)

我不知道这还什么性能限制在这里面。。可能也只有HW等级了吧。所以,我不知道我们应该是否要一台足够大的HW去测试;-)--当前,只通过单个1Gbit的带宽,我们能得到700K QPS,并且限制也只来源于单一网络,主要的问题就来自与客户端而非服务器。。- 所以,更像Memcached @InnoDB 缩放的背影,更好的比较“原始的”Memcached 本身:-)--


Kudos to Sunny and Jimmy! And my special thanks to Yoshinori (Facebook)! - I think this is an excellent example where a common work on a given problem provides a fantastic final result for all MySQL users!..

感谢Sunny和Jimmy!还要特殊感谢yoshinori(Facebook)!-我认为这是一个很典型的例子!

If you need some details about Memcached Plugin design - you may start your reading from here:https://blogs.oracle.com/MySQL/entry/nosql_memcached_api_for_mysql - while then, keeping in mind all presented here results, I let you imagine now what kind of performance you may expect if data will be accessed directly via "native" InnoDB API and by-passing the Memcached level.. ;-))

想要了解更多关于Memecached Plugin 的设计-你可以follow this link :https://blogs.oracle.com/MySQL/entry/nosql_memcached_api_for_mysql 。-然后,你把结果都印在心里面,我现在让你现在想象一下”如果是数据是直接通过“本地”(native)InnoDB API 访问的,然后通过Memcached 层面传输的“,你所期待是哪种性能?


Rgds,
-Dimitri
内容概要:本文深入探讨了Kotlin语言在函数式编程和跨平台开发方面的特性和优势,结合详细的代码案例,展示了Kotlin的核心技巧和应用场景。文章首先介绍了高阶函数和Lambda表达式的使用,解释了它们如何简化集合操作和回调函数处理。接着,详细讲解了Kotlin Multiplatform(KMP)的实现方式,包括共享模块的创建和平台特定模块的配置,展示了如何通过共享业务逻辑代码提高开发效率。最后,文章总结了Kotlin在Android开发、跨平台移动开发、后端开发和Web开发中的应用场景,并展望了其未来发展趋势,指出Kotlin将继续在函数式编程和跨平台开发领域不断完善和发展。; 适合人群:对函数式编程和跨平台开发感兴趣的开发者,尤其是有一定编程基础的Kotlin初学者和中级开发者。; 使用场景及目标:①理解Kotlin中高阶函数和Lambda表达式的使用方法及其在实际开发中的应用场景;②掌握Kotlin Multiplatform的实现方式,能够在多个平台上共享业务逻辑代码,提高开发效率;③了解Kotlin在不同开发领域的应用场景,为选择合适的技术栈提供参考。; 其他说明:本文不仅提供了理论知识,还结合了大量代码案例,帮助读者更好地理解和实践Kotlin的函数式编程特性和跨平台开发能力。建议读者在学习过程中动手实践代码案例,以加深理解和掌握。
内容概要:本文深入探讨了利用历史速度命令(HVC)增强仿射编队机动控制性能的方法。论文提出了HVC在仿射编队控制中的潜在价值,通过全面评估HVC对系统的影响,提出了易于测试的稳定性条件,并给出了延迟参数与跟踪误差关系的显式不等式。研究为两轮差动机器人(TWDRs)群提供了系统的协调编队机动控制方案,并通过9台TWDRs的仿真和实验验证了稳定性和综合性能改进。此外,文中还提供了详细的Python代码实现,涵盖仿射编队控制类、HVC增强、稳定性条件检查以及仿真实验。代码不仅实现了论文的核心思想,还扩展了邻居历史信息利用、动态拓扑优化和自适应控制等性能提升策略,更全面地反映了群体智能协作和性能优化思想。 适用人群:具备一定编程基础,对群体智能、机器人编队控制、时滞系统稳定性分析感兴趣的科研人员和工程师。 使用场景及目标:①理解HVC在仿射编队控制中的应用及其对系统性能的提升;②掌握仿射编队控制的具体实现方法,包括控制器设计、稳定性分析和仿真实验;③学习如何通过引入历史信息(如HVC)来优化群体智能系统的性能;④探索中性型时滞系统的稳定性条件及其在实际系统中的应用。 其他说明:此资源不仅提供了理论分析,还包括完整的Python代码实现,帮助读者从理论到实践全面掌握仿射编队控制技术。代码结构清晰,涵盖了从初始化配置、控制律设计到性能评估的各个环节,并提供了丰富的可视化工具,便于理解和分析系统性能。通过阅读和实践,读者可以深入了解HVC增强仿射编队控制的工作原理及其实际应用效果。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值