W3WP.EXE使用100%的CPU - 从哪里开始? [英] W3WP.EXE using 100% CPU - where to start?

查看:218
本文介绍了W3WP.EXE使用100%的CPU - 从哪里开始?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IIS6运行的ASP.NET Web应用程序定期射CPU高达100%。这是这是负责这些事件中,几乎所有CPU使用率的W3WP。则CPU保持在100%的固定的任何地方从几分钟到一个多小时。

这是一个临时的服务器上,该网站仅在这一点上得到测试者很轻的流量。

我们已经在服务器上运行蚂蚁探查,但它一直unenlightening。

我们

在哪里可以开始找出是什么导致这些事件,什么code期间所有的时间保持了CPU忙吗?


解决方案

  1. 标准的Windows性能计数器(查找其他相关活动,如许多的GET请求,过多的网络或磁盘I / O等);你可以从code,以及从perfmon中读取它们(如果​​CPU使用率超过阈值,例如启动数据收集)

  2. 自定义性能计数器(尤其是时间离箱请求和其他调用,其中执行时间是不确定的)

  3. 负载测试,使用工具如Vi​​sual Studio团队测试或WCAT

  4. 如果您可以测试或升级到IIS 7,您可以配置失败请求跟踪生成跟踪,如果请求采取更多的一定量的时间

  5. 使用LOGPARSER,看看哪些请求到达CPU尖峰时间

  6. code评论/穿行测试(尤其是查找可能无法正常终止循环,例如,如果一个错误发生,以及锁和潜在的线程问题,如使用静态的)

  7. CPU和内存分析(可能很难在生产系统)

  8. 的Process Explorer

  9. Windows资源监视器

  10. 详细错误记录

  11. 自定义跟踪记录,包括执行时间详细信息(也许是有条件的,基于CPU使用性能计数器)

  12. 是当程序池回收发生的错误?如果是这样,它可能是一个线索。

An ASP.NET web app running on IIS6 periodically shoots the CPU up to 100%. It's the W3WP that's responsible for nearly all CPU usage during these episodes. The CPU stays pinned at 100% anywhere from a few minutes to over an hour.

This is on a staging server and the site is only getting very light traffic from testers at this point.

We've running ANTS profiler on the server, but it's been unenlightening.

Where can we start finding out what's causing these episodes and what code is keeping the CPU busy during all that time?

解决方案

  1. Standard Windows performance counters (look for other correlated activity, such as many GET requests, excessive network or disk I/O, etc); you can read them from code as well as from perfmon (to trigger data collection if CPU use exceeds a threshold, for example)
  2. Custom performance counters (particularly to time for off-box requests and other calls where execution time is uncertain)
  3. Load testing, using tools such as Visual Studio Team Test or WCAT
  4. If you can test on or upgrade to IIS 7, you can configure Failed Request Tracing to generate a trace if requests take more a certain amount of time
  5. Use logparser to see which requests arrived at the time of the CPU spike
  6. Code reviews / walk-throughs (in particular, look for loops that may not terminate properly, such as if an error happens, as well as locks and potential threading issues, such as the use of statics)
  7. CPU and memory profiling (can be difficult on a production system)
  8. Process Explorer
  9. Windows Resource Monitor
  10. Detailed error logging
  11. Custom trace logging, including execution time details (perhaps conditional, based on the CPU-use perf counter)
  12. Are the errors happening when the AppPool recycles? If so, it could be a clue.

这篇关于W3WP.EXE使用100%的CPU - 从哪里开始?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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