简体   繁体   English

Azure 应用服务的糟糕表现 - Wordpress

[英]Horrible performance on Azure App Service - Wordpress

Evening All,晚上所有,

At by absolute wits end and hoping someone may be able to save me.在绝对的智慧结束并希望有人能够拯救我。 I am in the process of migrating a number of PHP applications into Azure: I am using:我正在将一些 PHP 应用程序迁移到 Azure:我正在使用:

  • Linux based App Service running PHP 7.4 (2 vCPUs, 8Gb RAM) at a cost of £94 a month.基于 Linux 的应用服务运行 PHP 7.4(2 个 vCPU,8Gb RAM),每月费用为 94 英镑。
  • Azure Database on MySQL 8.0 (2 vCPUs) at £114 a month. Azure MySQL 8.0(2 个 vCPU)上的数据库,每月 114 英镑。

My PHP apps run well, decent load time of under 1 second per page.我的 PHP 应用程序运行良好,每页加载时间不到 1 秒。 Wordpress performance however is awful.然而,Wordpress 的性能很糟糕。 I am going from a 1 second page load to around 10 seconds, particularly on the back end.我将从 1 秒的页面加载时间缩短到 10 秒左右,尤其是在后端。 I have read all of the Azure guides and have implemented the following obvious points:我已经阅读了所有 Azure 指南,并实施了以下明显的要点:

  • Both the App Service and the MySQL install are in the same data center App Service和MySQL安装都在同一个数据中心
  • App Service is set to 'Always On'应用服务设置为“始终开启”
  • Connection Redirection is set to Preferred and tested as working连接重定向设置为首选并测试为工作

The same app runs fine on a very basic £10 or so a month shared hosting package. I have also tried the same setup in Amazon Web Services today and page load is back to a second or so.同样的应用程序在非常基本的每月 10 英镑左右的共享主机 package 上运行良好。我今天也在亚马逊 Web 服务中尝试了相同的设置,页面加载恢复到一秒左右。

In Chrome Console, the delay is in TTFB.在 Chrome 控制台中,延迟在 TTFB 中。 I have disabled all the plugins and none stand out as making a huge difference.我已经禁用了所有插件,但没有一个能产生巨大的影响。 Each adds a second or so page load, suggesting to me a consistent issue when a page requires a number of database calls.每个都增加了第二个左右的页面加载,当一个页面需要多次数据库调用时,向我提出了一个一致的问题。

What is going on with Azure and the awful Wordpress performance?? Azure 和糟糕的 Wordpress 性能是怎么回事? Is there anything else I can investigate or try.还有什么我可以调查或尝试的吗? Really keen to stay with Azure but can't cope with the huge increase in cost for a performance hit.真的很想留在 Azure 上,但无法应对性能下降带来的成本大幅增加。

The issue turned out to be the way the file system runs in the app service.问题原来是文件系统在应用程序服务中运行的方式。 It is NOT an issue with the database.这不是数据库的问题。 The App Service architecture is just too slow at present with file read/writes, of which Wordpress uses a lot. App Service架构目前文件读写速度太慢,其中Wordpress使用较多。 Investigated the various file cache options but none improved enough.调查了各种文件缓存选项,但没有一个足够改进。

Ended up setting up a fairly basic, and significantly cheaper, virtual machine, running with the same database and performance is hugely improved.最终设置了一个相当基本且便宜得多的虚拟机,运行相同的数据库并且性能得到了极大的提高。

Not a great answer, but App Services are not up to Wordpress at present!不是很好的答案,但应用服务目前还没有达到 Wordpress!

The comments below are correct.下面的评论是正确的。 The "problem" is the database. “问题”是数据库。 You can either move MySQL to a Virtual Machine (which will give you a better performance) or you can also try to use cache plugins such as WP Super Cache as well decrease the number of requests.您可以将 MySQL 移动到虚拟机(这将为您提供更好的性能),或者您也可以尝试使用 WP Super Cache 等缓存插件来减少请求数量。

You can find a full list of tips in the following link:您可以在以下链接中找到完整的提示列表:

https://azure.microsoft.com/en-us/blog/10-ways-to-speed-up-your-wordpress-site-on-azure-websites/ https://azure.microsoft.com/en-us/blog/10-ways-to-speed-up-your-wordpress-site-on-azure-websites/

PS: ignore the date, it's still relevant PS:忽略日期,它仍然相关

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

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