IIS 上的大量请求超时

发布于 2024-11-03 23:08:28 字数 819 浏览 1 评论 0原文

我有一个相当繁忙的网站,每月浏览量约为 1000 万次。

我的一个应用程序池似乎堵塞了几个小时,我正在寻找一些有关如何解决该问题的想法..?我怀疑它不知何故耗尽了线程,但我不确定如何追溯确定这一点..?据我所知:

  • 该网站从未“宕机”,但大约 90% 的请求开始超时。
  • 我可以看到大量“HttpException - 请求超时”。在中断期间的日志中,
  • 我找不到任何可能导致超时的 SQL 错误或代码错误。
  • 超时似乎是整个网站范围内的所有页面。
  • 有一个页面存在错误,可能会导致该特定页面出现错误。
  • 该网站必须重新启动。

该网站是 ASP.NET C# 3.5 WebForms..

可能性:

  1. 线程耗尽: 我的想法是导致错误的页面可能以某种方式启动堵塞可用线程?
  2. 全局代码错误:另一种可能性是我的一个静态类在某处存在未被发现的错误。这不太可能,因为以前从未发生过这种情况,而且我找不到这些类的任何日志错误,但这是有可能的。

更新

我现在已经设法在问题发生时追踪到它。页面正在正常加载,但由于某种原因,WebResource.axdScriptResource.axd需要一分钟才能加载。在性能计数器中,我可以看到此时 ASP.NET 请求排队峰值。

I have a fairly busy site which does around 10m views a month.

One of my app pools seemed to jam up for a few hours and I'm looking for some ideas on how to troubleshoot it..? I suspect that it somehow ran out of threads but I'm not sure how to determine this retroactively..? Here's what I know:

  • The site never went 'down', but around 90% of requests started timing out.
  • I can see a high number of "HttpException - Request timed out." in the log during the outage
  • I can't find any SQL errors or code errors that would have caused the timeouts.
  • The timeouts seem to have been site wide on all pages.
  • There was one page with a bug on it which would have caused errors on that specific page.
  • The site had to be restarted.

The site is ASP.NET C# 3.5 WebForms..

Possibilities:

  1. Thread depletion: My thought is that the page causing the error may have somehow started jamming up the available threads?
  2. Global code error: Another possibility is that one of my static classes has an undiscovered bug in it somewhere. This is unlikely as the this has never happened before, and I can't find any log errors for these classes, but it is a possibility.

UPDATE

I've managed to trace the issue now while it's occurring. The pages are being loaded normally but for some reason WebResource.axd and ScriptResource.axd are both taking a minute to load. In the performance counters I can see ASP.NET Requests Queued spikes at this point.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

酒中人 2024-11-10 23:08:28

我首先要尝试的是 Sam Saffron 的 CPU 分析工具,如果有常见的事情发生太多/太长时间,它应该给出指示。部分原因是它不涉及任何改变;只需在服务器上运行它即可。

之后,还有各种其他调试工具可用;我们发现一些非常贫民窟的方法可以非常有效地看到时间花在哪里(当然,它只对 10% 的成功结果有效)。

当然,您可以打开服务器分析工具并拖入各种 .NET / IIS 计数器,这可能可以帮助您发现一些事情。

在这三个选项之间,您应该涵盖:

  • 代码掉入黑洞并且永远不会出来(通常与线程相关)
  • 代码运行,但速度太慢(通常与数据访问相关)

The first thing I'd try is Sam Saffron's CPU analyzer tool, which should give an indication if there is something common that is happening too much / too long. In part because it doesn't involve any changes; just run it at the server.

After that, there are various other debugging tools available; we've found that some very ghetto approaches can be insanely effective at seeing where time is spent (of course, it'll only work on the 10% of successful results).

You can of course just open the server profiling tools and drag in various .NET / IIS counters, which may help you spot some things.

Between these three options, you should be covered for:

  • code dropping into a black hole and never coming out (typically threading related)
  • code running, but too slowly (typically data access related)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文