简体   繁体   中英

Why is my azure webapp request sometimes slow

My azure web application sometimes reacts very slowly. He waits a few seconds before executing the request.

  • Of course I have the setting "always on" turned on.
  • It's running on a S2 service plan.
  • Avg users online 3
  • No vertical or horizontal scaling configured.

Application

  1. Asp.net MVC
  2. .net Framework 4.6.1
  3. C#

Does anyone have an idea why this problem occasionally occurs?

Azure 应用洞察 - 配置文件

Ok i see based on your picture that there is a wait time of 98.71% and lots of wait time from the compiler, so i would recommend you to consider to use precompiled views on your mvc app, to avoid the runtime compilation of the views. If you are using Azure DevOps, you should be able to change your task to build the solution and add the following options on the MSBuild arguments.

/p:PrecompileBeforePublish=true /p:UseMerge=true /p:SingleAssemblyName=AppCode

When you see the WebApp being slow it is important to understand what HTTP requests are slow and whether those HTTP requests are slow all the time or it is an intermittent issue? How are the CPU and memory metrics and what is the pattern of slowness? If you have application Insights enabled please navigate to the "Performance" tab to see the requests were are slow and whether they are dependent on an external component.

Collecting CLR profiler in the context of slowness will reveal where the time is spent.

You can navigate to Azure Portal-->WebApp-->Diagnose and solve problem blade-->Diagnostic tools-->Autoheal and enable the rule to collect the CLR profiler traces on slowness.

Once the rule triggers it will collect the profiler traces and build a report for your review.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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