简体   繁体   English

为什么我的 azure webapp 请求有时很慢

[英]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.他在执行请求之前等待了几秒钟。

  • Of course I have the setting "always on" turned on.当然,我打开了“始终开启”的设置。
  • It's running on a S2 service plan.它在 S2 服务计划上运行。
  • Avg users online 3平均在线用户 3
  • No vertical or horizontal scaling configured.未配置垂直或水平缩放。

Application应用

  1. Asp.net MVC ASP.NET MVC
  2. .net Framework 4.6.1 .net 框架 4.6.1
  3. C# 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.好的,我根据您的图片看到,等待时间为 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.

相关问题 .NET HttpClient 在 Azure WebApp 中缓慢或无响应 - .NET HttpClient slow or not responding in Azure WebApp Azure WebApp未加载我的字体 - Azure WebApp not loading my fonts Azure ASP .net WebApp请求超时 - Azure ASP .net WebApp The request timed out 为什么WMI查询有时会这么慢? - Why are WMI Queries so slow sometimes? 为什么我的 azure 函数有时无法读取静态配置变量? - Why does my azure function sometimes fail to read a static configuration variable? 为什么有时收不到使用 Azure SendGrid 从我的 ASP.Net 核心 Web 应用程序发送的电子邮件 - Why are my emails sent from my ASP.Net core web app using Azure SendGrid sometimes not being received 为什么我的射线广播有时会检测到命中,而有时却找不到? - Why does my raycast sometimes does detect a hit and sometimes wont? 即使打开AlwaysOn,我的Azure WebApp似乎也处于空闲状态 - My Azure WebApp seems to go idle even with AlwaysOn turned on 在我的 MVS Web 应用程序中为 Azure EventGrid Webhook 设置 HTTP 终结点? - Setting up an HTTP endpoint for Azure EventGrid Webhook in my MVS Webapp? 如何从App Settings Azure(webapp)到我的webjob接收数据 - How to receive data from App Settings Azure (webapp) to my webjob
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM