[英]Why is my azure webapp request sometimes slow
My azure web application sometimes reacts very slowly.我的 azure web 应用程序有时反应很慢。 He waits a few seconds before executing the request.
他在执行请求之前等待了几秒钟。
Application应用
Does anyone have an idea why this problem occasionally occurs?有谁知道为什么偶尔会出现这个问题?
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.好的,我根据您的图片看到,等待时间为 98.71%,编译器等待时间很长,因此我建议您考虑在 mvc 应用程序上使用预编译视图,以避免视图的运行时编译。 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.
如果您使用 Azure DevOps,您应该能够更改您的任务以构建解决方案并在 MSBuild 参数中添加以下选项。
/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?当您看到 WebApp 变慢时,重要的是要了解哪些 HTTP 请求变慢以及这些 HTTP 请求是一直变慢还是间歇性问题? How are the CPU and memory metrics and what is the pattern of slowness?
CPU 和内存指标如何,缓慢的模式是什么? 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.在缓慢的上下文中收集 CLR 分析器将揭示时间花在哪里。
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.您可以导航到 Azure 门户-->WebApp-->诊断和解决问题刀片-->诊断工具-->自动修复并启用规则以收集慢速的 CLR 分析器跟踪。
Once the rule triggers it will collect the profiler traces and build a report for your review.规则触发后,它将收集分析器跟踪并构建报告供您查看。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.