简体   繁体   English

WordPress数据库性能:Percona服务器vs MySQL没有InnoDB

[英]WordPress database performance: Percona server vs MySQL w/o InnoDB

I don't want to ask a subjective "which DBMS is best?" 我不想问一个主观的“哪个DBMS最好?” or "which DBMS of these two is better?". 或“这两个DBMS哪个更好?”。 This doesn't have to be a fanboy debate. 这不一定是一场粉丝辩论。

Rather, I welcome any benchmark test results or specific experiences, when it comes to one specific criteria - performance - especially with respect to one particular application: WordPress. 相反,我欢迎任何基准测试结果或特定经验,当谈到一个特定的标准 - 性能 - 特别是对于一个特定的应用程序:WordPress。

I understand that WordPress doesn't use InnoDB, and so disabling InnoDB in MySQL can speed things up. 据我所知,WordPress不使用InnoDB,因此在MySQL中禁用InnoDB可以加快速度。 On the other hand, Percona is a MySQL fork that replaces InnoDB with XtraDB and also claims to be highly efficient, high-performance. 另一方面,Percona是一个MySQL分支,用XtraDB取代InnoDB,并声称是高效,高性能的。

How does each stack up on performance when it comes to running WordPress? 在运行WordPress时,每个如何叠加性能? (no need for competition...both might come out looking very well, for all I know) (不需要竞争......对于我所知道的一切,两者都可能看起来很好看)

I have tried searching generally on Google, but haven't come across so much as an intelligent discussion, let alone performance benchmark tests. 我一直尝试在Google上进行搜索,但是没有遇到过智能讨论,更不用说性能基准测试了。

Would greatly appreciate if any of the experts here could share their experiences. 如果这里的任何专家能够分享他们的经验,我将不胜感激。 Many thanks! 非常感谢!

And please keep any smug, snide comments like "why don't YOU try" to yourself. 请保持任何自鸣得意的讽刺评论,例如“为什么不试试”给自己。 If I could, I would. 如果可以,我愿意。 And the purpose of Stack Overflow is to share expertise and learn from each-other, not to do everything yourself. Stack Overflow的目的是分享专业知识并相互学习,而不是自己做所有事情。

This question is less "MySQL vs. Percona Server" than "MyISAM vs. InnoDB/XtraDB". 这个问题不是“MySQL vs. Percona Server”,而是“MyISAM vs. InnoDB / XtraDB”。 They both have their own performance characteristics and which storage engine is right for you largely depends on your workload. 它们都有自己的性能特征,哪种存储引擎适合您,很大程度上取决于您的工作负载。 Most Wordpress sites are low traffic and read-mostly, so as long as your data fits into your buffer pool (for InnoDB/XtraDB) or key cache (for MyISAM), I would expect not-too-dissimilar performance. 大多数Wordpress站点都是低流量和大多数读取,因此只要您的数据适合您的缓冲池(对于InnoDB / XtraDB)或密钥缓存(对于MyISAM),我预计会有不同的性能。

Having done a lot of work on Wordpress database optimization, I can tell you that the performance of your Wordpress site depends more upon the class of your hardware and your chosen plugins. 在Wordpress数据库优化方面做了大量工作之后,我可以告诉你,Wordpress网站的性能更多地取决于你的硬件类和你选择的插件。

  • You should use a Caching plugin so that you can just avoid a ton of database read requests 您应该使用Caching插件,这样您就可以避免大量的数据库读取请求
  • You should avoid plugins that issue expensive queries (sadly, this covers most plugins) 您应该避免发出昂贵查询的插件(遗憾的是,这涵盖了大多数插件)
  • You should prune your comments (usually comments are 99+% SPAM so the ones that are marked as spam are just sitting in your database taking up space) 您应该删除您的评论(通常评论是99 +%垃圾邮件,因此标记为垃圾邮件的评论仅占用数据库占用空间)
  • Your host should have enough RAM for the hot dataset to fit in memory 您的主机应具有足够的RAM以使热数据集适合内存

If you really want to go into detail about MyISAM vs. InnoDB/XtraDB, you can check out the following links: 如果您真的想详细了解MyISAM与InnoDB / XtraDB,请查看以下链接:

http://www.mysqlperformanceblog.com/2009/01/12/should-you-move-from-myisam-to-innodb/ http://www.rackspace.com/knowledge_center/article/mysql-engines-myisam-vs-innodb http://www.mysqlperformanceblog.com/2009/01/12/should-you-move-from-myisam-to-innodb/ http://www.rackspace.com/knowledge_center/article/mysql-engines-myisam- VS-的InnoDB

So, to make a long answer even longer, you'll need to profile your MySQL instance after you can generate production traffic. 因此,为了使答案更长,您需要在生成生产流量后对MySQL实例进行概要分析。 I know you said you couldn't, but ... this question is kind of like me asking "What haircut would look best on me", without including a picture. 我知道你说你不能,但是......这个问题有点像我问“什么样的发型对我来说最好”,不包括图片。

Wordpress can use InnoDB (or XtraDB) just fine. Wordpress可以使用InnoDB(或XtraDB)。 I have done consulting and training for sites that host WordPress at scale, using any of MyISAM, InnoDB, and XtraDB. 我已经使用MyISAM,InnoDB和XtraDB中的任何一个对大规模托管WordPress的网站进行了咨询和培训。

WordPress 3.5.1 creates tables without specifying the storage engine. WordPress 3.5.1创建表而不指定存储引擎。 So it honors the default storage engine on whatever instance of MySQL you're using. 所以它尊重你正在使用的任何MySQL实例的默认存储引擎。 As of MySQL 5.5 (ca. December 2010), the default storage engine is InnoDB. 从MySQL 5.5(2010年12月)开始,默认存储引擎是InnoDB。 I tested installing WordPress on a virtual host running MySQL 5.6.10, and it created tables using the InnoDB storage engine. 我测试了在运行MySQL 5.6.10的虚拟主机上安装WordPress,并使用InnoDB存储引擎创建了表。

I don't have any benchmarks to share, but those would be of limited use anyway, because performance depends so much on the given hardware, the traffic load, and other factors. 我没有任何基准可供分享,但无论如何这些基准都是有限的,因为性能在很大程度上取决于给定的硬件,流量负载和其他因素。

A CMS like WordPress tends to be heavily weighted toward read-only queries. 像WordPress这样的CMS往往对于只读查询非常重要。 This is where InnoDB should give good benefit, because it caches data pages as well as indexes. 这就是InnoDB应该带来好处的地方,因为它可以缓存数据页面和索引。 MyISAM only caches indexes, and relies on the filesystem cache to hold data. MyISAM仅缓存索引,并依赖文件系统缓存来保存数据。

So the key to making WordPress perform well is to allocate enough innodb_buffer_pool_size to hold the data and indexes for all your tables. 因此,使WordPress运行良好的关键是分配足够的innodb_buffer_pool_size来保存所有表的数据和索引。 The data size of a WordPress site (even one with hundreds of articles) isn't typically very large, so you probably only need a few GB of buffer pool to hold all frequently-requested data in the buffer. WordPress站点(甚至包含数百篇文章的站点)的数据大小通常不是很大,因此您可能只需要几GB的缓冲池来保存缓冲区中所有经常请求的数据。 Once the data and index pages have populated the InnoDB buffer pool, 99.9% of your queries will be served out of RAM, and the site will have great performance. 一旦数据和索引页面填充了InnoDB缓冲池,99.9%的查询将从RAM中提供,并且该站点将具有出色的性能。

As with any caching system, the real killer to performance is when your "hot" data is larger than the cache, forcing queries to incur disk I/O. 与任何缓存系统一样,性能的真正杀手是当“热”数据大于缓存时,强制查询引发磁盘I / O. A single disk I/O is worth a few thousand RAM accesses, so you want to serve content completely out of RAM as much as possible. 单个磁盘I / O值得几千个RAM访问,因此您希望尽可能地完全从RAM中提供内容。

The improvements in XtraDB are designed to help as the number of Threads_running gets higher, or the buffer pool gets larger (eg dozens of GB). XtraDB中的改进旨在帮助随着Threads_running的数量变得更高,或者缓冲池变得更大(例如几十GB)。 It's unlikely that a single WP site will exercise either MySQL or Percona Server so heavily that these improvements will offer more than a slight advantage. 单个WP站点不太可能如此严重地运行MySQL或Percona Server,这些改进将提供更多的优势。 Unless you're going to host hundreds of WP sites on a given server like a hosting company. 除非您要在托管公司等托管服务器上托管数百个WP站点。

You may even find that the bottleneck ceases to be the database, and then you need to focus on front-end optimizations. 您甚至可能发现瓶颈不再是数据库,然后您需要专注于前端优化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM