您如何分析您的网站/网络应用程序?
这是根据社区在 Profiling web Application 方面所做的信息收集的经验。
几年前,我使用 CORBA ORB 参与了一个非常大的 C++/Java 项目,我们使用 Rational Purify/CodeCoverage 来检测、检测内存泄漏并发现服务器代码上的瓶颈。从那时起,我就没有任何在 .NET 平台上使用此类工具的经验,无论是在纯 C# 上还是在 Web 应用程序上工作,
- 您使用工具吗?
- 您是否估算流量并计算所需的预期带宽?
- 您是否对服务器代码和网页渲染进行了不同的分析?
- 您使用什么代码覆盖率工具?
我知道这是一个很大的话题。我得到的一些信息来自《Java 性能分析》一书WebSites”,他负责 Java 平台和该平台的参考工具,但提出了一种可转移的方法,因此核心思想普遍适用。
This is to collect from the experience that the community has done information on the aspect of Profiling web Application.
Some years ago I worked at a very large project in C++/Java with the a CORBA ORB and we were using Rational Purify/CodeCoverage to instrument, detect memory leaks and discover bottlenecks on server code. From that time I did not have any experience on using tools like that on the .NET platform either working on pure c# or with a web application
- Do you use tools?
- Do you estimate traffic and do calculations on the expected bandwidth needed?
- Do you profile differently server code and web page rendering?
- What code coverage tool are you using?
I know this is a very big topic. Some information I have are from the book "Performance Analysis for Java WebSites", who is fo the Java platform and reference tools for that platform but ises an approach that is transferable and so the core ideas apply generally.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
作为免费的负载测试解决方案,我使用了 Pylot。我确信如果您有预算,会有更好的付费解决方案。
如果您可以估计流量,则可以使用该工具的输出来评估项目的可扩展性。使用 asp.net 输出缓存可以显着提高站点在负载下的性能,因此如果您的每秒页面浏览量低于您的要求,请尝试此操作。
为了优化您的客户端渲染速度,请使用:
并且 js/css 资源正在缓存等。
如果开发 ASP.NET Web 表单应用程序,您可以通过修改页面指令来启用页面跟踪,使其包含
这将帮助您找到需要更长时间呈现的控件。
如果您遇到服务器端代码速度缓慢的问题,我发现几乎总是数据库导致问题。您需要检查返回结果速度慢的 SQL;如果发现任何情况,您需要考虑将新索引应用到表中。如果您的应用程序与数据库的关系过于频繁,您需要考虑减少对数据库的调用次数。要查找这些问题,您可以使用 SQL Server Profiler;它与 SQL Server 2005/2008 Developer 版本捆绑在一起。
如果您有预算,您肯定想查看 Redgate ANTS Performance Profiler 来分析您的服务器端代码。
As a free load testing solution I have used Pylot. I am sure there are better paid solutions if you have a budget.
If you can estimate traffic, this is the tool whose output you evaluate the scalabiltiy of your project against. Using the the asp.net output cache can improve your site performance under load significantly, so try this if your page views a second are less than you require.
For optimising your client side rendering speed use:
and js/css resources are being cached etc.
If developing a asp.net web forms app you can enable page tracing by modifying your page directive so it contains
This will help you find controls which take longer to render.
If you have an issue with server side code being slow I have found it is almost always the database causing the issue. You need to check for SQL which is slow to return a result; if you find any you need to look at applying new indexes to your tables. If your app is too chatty with the database you need to look at reducing the number of calls to the database. To find these problems you can use SQL Server Profiler; this comes bundled with SQL Server 2005/2008 Developer edition.
If you have the budget, you definitely want to check of out Redgate ANTS Performance Profiler for profiling your server side code.
我使用 dotTrace 进行分析,同时使用 jMeter 模拟流量。我发现 dotTrace 的集成度比 ANTS 好得多,而且通常报告更有用。
I use dotTrace to profile while using jMeter to simulate traffic. I have found dotTrace to be far better integrated than ANTS, and generally the reports more useful.
分析多层、分布式 Web 应用程序(服务器端) 显示了一种高级方法(在 URL 级别进行分析),即:
这个想法是使用现有网络日志并将其转换为“一张图片胜过 1000 个单词”类型的图表。
这种方法可能不足以满足需要更精细细节的用例,但它对我个人有帮助,并且可能值得探索。
Profiling a multi-tiered, distributed, web application (server side) shows a high level approach (profiling on the URL level) that is:
The idea is to use existing web logs and convert them into a "one-picture is worth a 1000 words" kind of chart.
This approach may not be sufficient for use-cases requiring more fine-level detail, but it helped me personally, and may be worth exploring.