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

标签 c# asp.net-mvc azure azure-web-app-service

我的 Azure Web 应用程序有时 react 非常慢。他在执行请求之前等待了几秒钟。

  • 当然,我打开了“始终开启”设置。
  • 它在 S2 服务计划上运行。
  • 平均在线用户3
  • 未配置垂直或水平缩放。

申请

  1. Asp.net MVC
  2. .net 框架 4.6.1
  3. C#

有人知道为什么这个问题偶尔会发生吗?

Azure Appl insights -profile

最佳答案

好吧,根据你的图片,我看到有 98.71% 的等待时间,并且编译器有很多等待时间,所以我建议你考虑在你的 mvc 应用程序上使用预编译 View ,以避免运行时编译观点。如果您使用的是 Azure DevOps,您应该能够更改构建解决方案的任务,并在 MSBuild 参数上添加以下选项。

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

关于c# - 为什么我的 azure webapp 请求有时很慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60335552/

相关文章:

c# - Windows 手机 8 : Play YouTube live event stream

asp.net-mvc - 开发人员工具中缺少页面表单数据

c# - Visual Studio 2013 中的浏览器链接

Azure 上的 Git 使用常见工具(例如 SourceTree)

security - B2C : Is there Insurance Against Scripted Attacks?

c# - 如何将外部 .exe 添加到我的 C# 项目中?

c# - 将 Excel 导入 ASP.NET 时的 OleDbDataAdapter 和列转换

c# - DataAdapter.Fill(数据集)

asp.net-mvc - asp.net mvc 中的多步注册过程问题( Split View模型,单个模型)

azure - 如何使用 powershell 等待操作完成