4
votes

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.

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.

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 and memory look fine from the insights live data when those delays happen.

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?

EDIT:

Here's the unknown_async long wait time

Application code is fast enough, even with very basic requests it lags hard.

1
I don't have much experience with Azure, but could it be network overhead? I know on AWS, we have to group our services on the same VPC. If it's on another there may just be a bunch of firewalls and whatnot slowing it down. - Brobin
Could you post more details for these slow async requests as you said? I think it's a special case for what you did, not general for all. So if you can post some code for explaining what you did as async request handling, I think it's very helpful to resolve your performance issue. - Peter Pan
@PeterPan-MSFT I added a picture that shows application insights profiling. I have no idea what it is, also I don't understand why it says UNKNOWN_ASYNC - Jose Contreras Pereira
@Brobin That's one of the things I tried first, moving all related stuff to the same resource group since it was in different locations but it did not really did much - Jose Contreras Pereira

1 Answers

0
votes

I ended up contacting the paid support in Azure and they recommended changing from FastCGI to httpPlatformHandler following this tutorial

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