简体   繁体   English

在Azure上分析ASP.NET MVC3应用程序的预热

[英]Profiling warm-up of ASP.NET MVC3 Application on Azure

Throughout the process of developing my Application, the first-response time has got worse and worse, It is now taking 10 minutes to load! 在开发我的应用程序的整个过程中,第一响应时间变得越来越糟,现在需要10分钟才能加载! I am using Web-Deploy to speed up publishing my changes, and from what i've read on MSDN, i understand that this delay is due to compilation and loading assemblies. 我正在使用Web-Deploy加速发布我的更改,从我在MSDN上阅读的内容中,我知道这种延迟是由编译和加载程序集引起的。

It's an ASP.NET MVC3 Application which uses EF CodeFirst, MVC-MiniProfiler etc. Im wondering if its one of these assemblies that is slowing things down. 它是一个使用EF CodeFirst,MVC-MiniProfiler等的ASP.NET MVC3应用程序。我想知道它的其中一个组件是否会减慢速度。

Is there a way to track down the long running process plaguing my development/testing process? 有没有办法追踪困扰我的开发/测试过程的长时间运行过程?

As a side note, the issue is nowhere near as bad in the Azure Emulator. 作为旁注,Azure模拟器中的问题远没有那么糟糕。

Using Windows Azure SDK 1.4 and later, you have the option to enable Profiling for you application (beside the IntelliTrace). 使用Windows Azure SDK 1.4及更高版本,您可以选择为您的应用程序启用性能分析(IntelliTrace旁边)。 You can read about some of the options available (in 1.5) from my blog post here where you will also find a good screenshot showing the option to enable either IntelliTrace or Profiling. 您可以从我的博客文章中了解一些可用的选项(在1.5中), 这里您还可以找到一个很好的屏幕截图,显示启用IntelliTrace或Profiling的选项。 The trick is that you can only have one of them running (either ItelliTrace or Profiling). 诀窍是你只能运行其中一个(ItelliTrace或Profiling)。 So I suggest you first run the ItelliTrace and inspect ItelliTrace logs for any exceptions during your application execution. 因此,我建议您首先运行ItelliTrace并检查ItelliTrace日志,以了解应用程序执行期间的任何异常。 Then do another deployment using Profiling to catch which are the most time consuming methods. 然后使用Profiling进行另一次部署以捕获哪些是最耗时的方法。 Please note that enabling IntelliTrace /Profiling is only accomplishable during deployment process, and cannot be changed with simple WebDeploy, so you'll have to make at least two deployments for test. 请注意,启用IntelliTrace / Profiling只能在部署过程中完成,并且无法使用简单的WebDeploy进行更改,因此您必须至少进行两次部署才能进行测试。

It's hard to say what the slowdown is - as Awais mentioned, IntelliTrace is your friend. 很难说减速是什么 - 正如Awais所说,IntelliTrace是你的朋友。 However, the delay might be unavoidable (I have seen this a number of times). 然而,延迟可能是不可避免的(我已经多次看到过这种情况)。 If this is the case, you can add a startup script that will "prime" IIS, preventing the problem when the first user hits the site. 如果是这种情况,您可以添加一个“启动”IIS的启动脚本,以防止第一个用户访问该站点时出现问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM