简体   繁体   English

Django Web 应用程序中的 Azure 响应时间缓慢

[英]Azure slow response time in Django web app

For a long time I've been managing an Azure web site in testing, staging and production environments.很长一段时间以来,我一直在测试、暂存和生产环境中管理 Azure 网站。 Initially, all of them were free and I noticed the server sometimes was very slow to respond to async requests.最初,它们都是免费的,我注意到服务器有时响应异步请求的速度非常慢。 Some requests took 15-30 seconds to complete on the Azure web site.某些请求需要 15-30 秒才能在 Azure 网站上完成。 A local copy running on IIS worked with no problem and request times ranged from 75ms to 400ms.在 IIS 上运行的本地副本没有问题,请求时间从 75 毫秒到 400 毫秒不等。

At first I thought the problem with the Azure websites was the 'Always on' feature but after upgrading the production server to a Standard 2 level the exact same problems still exist.起初我认为 Azure 网站的问题是“永远在线”功能,但在将生产服务器升级到标准 2 级别后,完全相同的问题仍然存在。

Recently I ran a profile with Application Insights and the report for the slow requests shows something named ASYNC_UNKOWN and those 15-30 seconds are there, the actual request only takes a few ms.最近,我使用 Application Insights 运行了一个配置文件,慢速请求的报告显示了名为 ASYNC_UNKOWN 的内容,并且有 15-30 秒,实际请求只需要几毫秒。

CPU and memory look fine from the insights live data when those delays happen.当这些延迟发生时,CPU 和内存从洞察实时数据看起来很好。

I don't know what else to do, I'm thinking about dropping Azure and go to some other hosting.我不知道还能做什么,我正在考虑放弃 Azure 并转到其他托管服务。 I tried hosting the development site on pythonanywhere and it works just fine there.我尝试在 pythonanywhere 上托管开发站点,并且在那里运行良好。 Can someone give me a clue about what could be causing this massive delays on Azure?有人可以告诉我是什么原因导致 Azure 出现如此大的延迟吗?

EDIT:编辑:

Here's the unknown_async long wait time这是unknown_async漫长的等待时间

Application code is fast enough, even with very basic requests it lags hard.应用程序代码足够快,即使是非常基本的请求,它也很难滞后。

I ended up contacting the paid support in Azure and they recommended changing from FastCGI to httpPlatformHandler following this tutorial我最终联系了 Azure 中的付费支持,他们建议按照本教程从 FastCGI 更改为 httpPlatformHandler

https://azureossd.github.io/2017/09/01/django-app-with-httpplatformhandler-in-azure-app-services-windows/ https://azureossd.github.io/2017/09/01/django-app-with-httpplatformhandler-in-azure-app-services-windows/

Performance seems to be better and response times are now in a more acceptable level性能似乎更好,响应时间现在处于更可接受的水平

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

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