ASP.NET 分析
我有一个运行缓慢的 ASP.NET 程序。我想分析生产服务器以了解发生了什么,但我不想显着减慢生产服务器的速度。
一般来说,分析生产框或本地开发框是标准做法吗?另外,您推荐哪些程序来实现这一目标?
I have a slow asp.net program running. I would like to profile the production server to see what is going on, but I don't want to slow down the production server noticeably.
In general, is it standard practice to profile a production box or just local dev boxes? Also, what progams do you recommend to accomplish this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我可以推荐您使用“dynatrace Ajax Edition 3”进行客户端分析(它是免费的,并且简单的工具)和“JetBrains dotTrace”用于服务器端分析。据我所知,该工具不会减慢服务器速度。
I can recommend you to use "dynatrace Ajax edition 3" for client side profiling (it's free and easy tool) and "JetBrains dotTrace" for server side profiling. This tools does not slow down server as i know.
您可以使用跟踪,建议在本地计算机上检查这些内容,但如果您想在服务器上检查某些内容,可以在 web.config 中启用跟踪。
ASP.NET 跟踪概述
在 ASP.NET 中进行跟踪
You can use
Tracing
and it is recommended to check these things on your local machine, but if you want to check something on server, you can enable tracing for short in your web.config.ASP.NET Tracing Overview
Tracing in ASP.NET
我想答案确实是“视情况而定”!我首先会考虑程序是否仅在生产服务器上运行缓慢,或者是否在开发环境上运行缓慢。我还会考虑如何使我的开发/测试环境与生产环境相匹配。
完成此操作后,请考虑是否有任何区域可能代表您可以消除的明显瓶颈。例如,ASP.NET 应用程序是否由某种形式的数据库支持?如果是,您可以单独监视数据库的性能并确定这是否是问题所在。
接下来,尝试非常具体地说明“性能缓慢”的含义。它是否一直很慢(与什么相比?),或者只是当您执行特定操作时。这可能会为您提供另一个线索,让您知道问题出在哪里,或者至少您应该问哪些问题。
回答了很多这样的问题后,我就会抛出 ANTS性能分析器尝试分析正在发生的情况。在分析应用程序时,它的开销相当小,而且您实际上应该只运行它相当短的时间,因为此时您希望有更具体的问题要回答,或者具体的操作要执行深入挖掘。
I guess the answer is really 'it depends'! I would start by considering whether the program runs slowly just on the production server, or whether it runs slowly on a development environment as well. I would also consider how closely I could get my development/test environment to match the production environment.
Once you've done that, consider whether there are any areas that could represent obvious bottlenecks that you might be able to eliminate. So, for example, is the ASP.NET application backed by some form of database? If it is, you can monitor the performance of the database separately and establish whether that is where the problem lies.
Next, try and be very specific about what you mean by 'slow performance'. Is it consistently slow (compared to what?), or just when you do specific actions. This may give you another clue as to where your problem lies, or at least what questions you should be asking.
Having answered lots of these questions, I'd then bust out ANTS Performance Profiler to try and profile what's going on. It has a fairly minimal overhead when profiling an application, and you should only really be running it for a fairly short time anyway, as you'll hopefully by this point have more specific questions you want to answer, or specific actions that you want to dig into.
您最好的选择是 Prefix (http://www.prefix.io)。它可以让您查看所有 SQL 查询、日志、HTTP 调用等等。
另一个选择是 Glimpse 或 Mini profiler。
Your best option is Prefix (http://www.prefix.io). It will let you see all of your SQL queries, logs, HTTP calls, and a lot more.
Another option is Glimpse or the Mini profiler.