Azure Web Apps 真的很慢 [英] Azure Web Apps are really slow

查看:17
本文介绍了Azure Web Apps 真的很慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在调查我的生产应用程序的缓慢预热时间,我得到了一些意想不到的结果.

I've been investigating a slow warmup time for my production app and I got some unexpected results.

在各种 Azure VM 上进行的测试表明,预热时间与应用服务器性能密切相关(因此它不是外部请求,包括 sql),但真正有趣的是与 Azure Web Apps 和我自己的本地计算机的比较(所有时间都是大约 3 次运行的平均值):

Testing on various Azure VMs showed the warmup time to be well-related to the application server performance (so it's not external request, including sql), but what's really interesting is the comparison to Azure Web Apps and my own local machine (all times are averages from at about 3 runs):

VM A0:            >1m
VM A2:            13s
VM D2V2:           6.8s
VM D5V2:           7.8s
Wep App P2:       25s
Web App S2:       26.5s
My local machine:  6.6s

我的本​​地机器是 3.3GHz 的 i5.

My local machine is an i5 with 3.3GHz.

本地机器最快即使它通过 Internet 连接到同一个 SQL Azure 数据库并且请求包括实体框架的模型检查.

所有测试都使用 .NET 4.6.1,这是目前的最新版本.

All tests use .NET 4.6.1, the newest release at this time.

明显的结论:

  • 对于不可并行化的作业,我使用 4 年的台式机比任何大小的 Azure VM 都快.
  • 即使您愿意每月花费 500 美元,Azure Web 应用也能在土豆上运行.

这看起来很可疑.任何想法可能会发生什么?或者测试什么?

This seems fishy. Any ideas what else might be going on? Or what to test?

在进行一些分析后进行以下内容都不能说明我的问题,但它仍然是有趣的信息(在附加分析器时在另一个总请求时间为 20 秒的 A2 VM 上进行了测试):

EDIT after some profiling: None of the following sheds any light on my question, but it's still interesting information (tested on another A2 VM with 20s total request time while the profiler being attached):

  • 58% 正在抖动.
  • 文件 IO 阻塞几乎为零(应用程序之前已经启动,所以我猜所有需要的 dll 部分都在内存缓存中).
  • <1% 是 SQL Azure 请求.
  • 因此,其余 90% 的运行时间应该是 .NET 执行或分析器开销.
  • 分析器本身有相当大的开销,因为没有它,请求仅在 15 秒内运行(我使用了 JetBrains dotTrace 的试用版,我非常喜欢)
  • 50% 的时间是在使用 Entity Framework 的第一个请求期间,其中 80% 的时间是在抖动
  • 15% 是第一次使用 SignalR,几乎没有抖动(做一些反射废话)

几乎没有进行并行化.

推荐答案

最初当我们部署我们的 Azure 应用服务 - Web 应用(托管在资源组 1)和我们的 Azure SQL 数据库(托管在资源组 2)时,应用程序非常慢的.我犯的错误是 RG1 和 RG2 都在两个不同的位置.后来,当我们将两个 RG 的位置(实际上是重新创建)更改为相同时,WebApp 开始顺利运行.

Initially when we deployed our Azure App Service - Web app (hosted in Resource Group1) and our Azure SQL database (hosted in Resource Group2), the app was very slow. The mistake that I made was that both the RG1 vand RG2 were in two different locations. Later, when we changed the location of both RGs (recreated them actually) to be the same then the WebApps started running smooth.

谢谢,大虾

这篇关于Azure Web Apps 真的很慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆