问题描述
很长一段时间以来,我一直在测试,登台和生产环境中管理Azure网站.最初,它们都是免费的,我注意到服务器有时对异步请求的响应非常慢.在Azure网站上完成一些请求需要15到30秒.在IIS上运行的本地副本可以正常工作,请求时间从75毫秒到400毫秒不等.
For a long time I've been managing an Azure web site in testing, staging and production environments. 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. A local copy running on IIS worked with no problem and request times ranged from 75ms to 400ms.
起初,我认为Azure网站的问题是始终在线"功能,但是在将生产服务器升级到Standard 2级别后,仍然存在完全相同的问题.
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.
最近,我使用Application Insights运行了一个配置文件,针对慢速请求的报告显示了一个名为ASYNC_UNKOWN的内容,并且那15-30秒在那里,实际请求仅需几毫秒.
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.
当发生延迟时,从实时数据中获得洞察,CPU和内存看起来很好.
CPU and memory look fine from the insights live data when those delays happen.
我不知道该怎么办,我正在考虑删除Azure并转到其他托管服务器.我尝试将开发站点托管在pythonanywhere上,并且在那里工作正常.有人可以给我一个线索,以了解导致Azure大量延迟的原因吗?
I don't know what else to do, I'm thinking about dropping Azure and go to some other hosting. I tried hosting the development site on pythonanywhere and it works just fine there. Can someone give me a clue about what could be causing this massive delays on Azure?
这是 unknown_async 漫长的等待时间
即使有非常基本的请求,应用程序代码也足够快.
Application code is fast enough, even with very basic requests it lags hard.
推荐答案
我最终联系了Azure中的付费支持人员,他们建议按照本教程将其从FastCGI更改为httpPlatformHandler.
I ended up contacting the paid support in Azure and they recommended changing from FastCGI to httpPlatformHandler following this tutorial
https://prmadi.com/django-app-with-httpplatformhandler-in-azure-app-services-windows/
性能似乎更好,响应时间现在处于可接受的水平
Performance seems to be better and response times are now in a more acceptable level
这篇关于Django Web应用程序中的Azure响应时间慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!