8
votes

Since about a week when I publish a new version of our Web App and do a Swap from Staging to Production, it actually seems to swap before the warmup initialization is done.

As it is a large application it will takes more then five minutes to warmup the site, making the application unresponsive.

I have official Azure support, but it is taking a long time to respond to this request and I still have no answer that works.

I can't fix any issues on our platform or publish a new version without bringing the whole site down for eight minutes. This is a highly visited website, with paying clients.

Does anyone know:

  • anything that I could investigate myself?
  • a workaround or any tips that I can take a look at myself to try to fix or work around this issue?

enter image description here

Extra information

I do use applicationInitialization, and I see that Azure is hitting the pages - it just happens after the swap instead of before.

<system.webServer>
    <applicationInitialization>
        <add initializationPage="/nl" hostName="mydomain.com" />
        <add initializationPage="/warmup-application-for-azure" hostName="mydomain.com" /> (special page just for warming up services)
        <add initializationPage="/deeplink1" hostName="mydomain.com" />
        <add initializationPage="/deeplink2" hostName="mydomain.com" />
        [etc]
    </applicationInitialization>
</system.webServer>
4
I do have same issue and even I am using applicationInitialization still wont help docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-8/…Vova Bilyachat
Btw same issue happens with Auto-scalingVova Bilyachat
Hi @VolodymyrBilyachat, thanks for your message and upvote. Did you also had it working before? I only have this problems recently - feels like a regression bug. I also have applicationInitalization in my web.config and I see Azure hitting the server - but after the swap is done.Dirk Boer
But what hitting us hard is autoscaling since nodes are added and they are not warmed up....Vova Bilyachat
Hi @VolodymyrBilyachat, thanks I did reply.Dirk Boer

4 Answers

1
votes

Maybe not 100% relative to this question but since I had similar issue with warm up I want to share how I solved it.

I used to have issue with auto-scaling because my nodes were not warmed up due to url rewrite module. So what if you have url rewrites in your app make sure that you are checking for

 <add input="{WARMUP_REQUEST}" pattern="1" negate="true" />  

Now this is in official documentation and it has link to common problems

0
votes

This was an Azure bug, confirmed by the Microsoft Azure team.

-1
votes

Sometimes hitting the site’s root URL is not enough to completely warm up the application. For example it maybe necessary to hit all important routes in an ASP.NET MVC app or to pre-populate the in-memory cache. That is where the Application Initialization Module can help.

When you use the warmup-functionality provided by IIS (and Azure) instead of those old-fashioned methods and if deploying to an App Service, just add a slot setting to make sure it always triggers such as below: enter image description here

This tutorial explains how you can use the recently enabled Application Initialization Module to completely warm up your application prior to swapping it into production.

-1
votes

So here is the important thing you should consider:

  • Unless you specify which url address azure needs to request to your website, how can it knows. If you don't do that, it only calls the root of the application

  • Even if you specify the url and your url needs to authorisation/authentication, how can azure sign in your website automatically and call the url that you specify.

You have got two option to deal with it.

1) Write your own warming up api to call your web application with authorisation/authentication. Then create a scheduler to call the application every hour or half an hour. It also allows you to keep the entire application up & running & warm. You can also set AlwaysOn feature under the Application Settings. You can also trigger this api on your CI/CD pipeline after the staging slot deployed successfully.

2) If you don't want to touch your CI/CD pipeline or whatever reason and don't want to write api, you should sign in to your web application, go through each page and warm it up manually. Then you can swap without any problem.