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

查看:142
本文介绍了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.3 GHz的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 Apps也可以在土豆上运行.

这似乎很可疑.还有其他想法吗?还是要测试什么?

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 App Service-Web应用程序(托管在Resource Group1中)和Azure SQL数据库(托管在Resource Group2中)时,该应用程序非常慢.我犯的错误是RG1 vand 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天全站免登陆