Azure App Service: Extended time to load each page after deployment (.NET Framework 4.7 web app)

Jason Snelders 1 Reputation point
2020-06-22T05:31:36.66+00:00

I have an S1 Production App Service configured for:
* .NET V4.7
* 64bit
* Integrated pipeline
* "Always on" is enabled.

I'm building a standard ASP.NET MVC 4.7.2 web application, and currently deploying using the the Publish option in Visual Studio 2019 Community.

I'm finding after each deployment to Azure, time for the first load of most pages (not just the first page I hit) is slow.
Specifically, it "feels" like each Controller has a slow initial load time, almost like each Controller needs to individually compile the first time it is accessed.

For example:

  1. I browse to /Controller1/Action1 and it's a 5-10 second compile.
  2. I browse to /Controller1/Action2 and it's <1s.
  3. I browse back to /Controller1/Action1 and it's now <1s.
  4. Then I browser to /Controller2/Action1 and against it has the delayed 5-10 second wait. Refresh the page and is <1s.

And so on.

I don't mind the very first time the first page is accessed after a deployment being slow, but not every page/controller. Especially when I'm deploying and testing multiple times per day.

Any ideas what is happening with this behaviour and how to fix it?

Update (45 mins later)

I wrote this after doing a deployment and noticing the behaviour described above. At the time I went through and test about 12 routes (pages) on the site.

I just did another deployment to the site and re-tested those routes and all were must faster on first load after deployment.
However, there were some routes I missed the first time that I tested after this deploy and they exhibited the same "slow on first load load" behaviour.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,913 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jason Snelders 1 Reputation point
    2020-06-25T07:23:52.487+00:00

    I had 5 mins and decided to quickly check out Application Insights. 30 mins later I'm down the rabbit hole. :)

    To be honest, I'm really not sure what I'm doing with App Insights, and I don't have time to learn all about about it, so I'm just guessing my way through at the moment.

    But even without a deploy I did manage to have one page take a long time to load.
    And I found the following screen.

    10645-insights1.png

    However, I can't find anything to drill into that will show me why the GET request took 17 seconds (page load time is usually <1s).

    Any suggestions of where I should be looking for better insights?

    Thanks.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.