简体   繁体   English

IIS7在5个请求后停止工作

[英]IIS7 stops working after 5 requests

Here is my problem: 这是我的问题:

I have just been brought onto a massive asp.net C# project and I've been charged with fixing some performance issues (not my area of expertise). 我刚刚参加了一个庞大的asp.net C#项目,我一直负责修复一些性能问题(不是我的专业领域)。 More specifically after 5 - 7 redirects/ajax calls the web server stops responding and the whole page (and eventually the browser) freezes. 更具体地说,在5-7次重定向/ ajax调用之后,Web服务器停止响应并且整个页面(以及最终的浏览器)冻结。

I don't think this is a coding issue as I've set up break points in a few pages (Page_Load method) and after the 5 requests it does not even reach the break points. 我不认为这是一个编码问题,因为我在几页(Page_Load方法)中设置了断点,在5个请求之后它甚至没有达到断点。

I don't believe this is related to this issue as I've increased the browser's maximum connections per server parameter and I got the same behavior. 我不相信这与此问题有关,因为我增加了浏览器的每个服务器参数的最大连接数,并且我得到了相同的行为。 Furthermore after these 5 request in one browser IE, the application stops working in FF as well. 此外,在一个浏览器IE中的这5个请求之后,应用程序也停止在FF中工作。

This is not a resource issue as the w3wp.exe process never exceeds 500MB memory. 这不是资源问题,因为w3wp.exe进程永远不会超过500MB内存。

One thing I've noticed when using Fiddler and other tools to monitor the requests is that the server takes a very long time when loading image files (png, jpg). 我在使用Fiddler和其他工具监控请求时注意到的一件事是服务器在加载图像文件(png,jpg)时需要很长时间。 I don't know if this is relevant. 我不知道这是否相关。

I've enabled failed request tracing on the server and the only thing I've noticed is that some request fail with a 401 error even dough I've set Anonymous Authentication to enabled. 我已经在服务器上启用了失败的请求跟踪,我唯一注意到的是,有些请求因401错误而失败,甚至我已将匿名身份验证设置为启用。 Here is the exact message 这是确切的消息

MODULE_SET_RESPONSE_ERROR_STATUS 

 ModuleName     ManagedPipelineHandler 

 Notification   128 
 HttpStatus     401 
 HttpReason     Unauthorized 
 HttpSubStatus  0 
 ErrorCode      0 

 ConfigExceptionInfo

 Notification   EXECUTE_REQUEST_HANDLER

 ErrorCode       The operation completed successfully. (0x0)

This message is sometimes thrown with ModuleName: ScriptModule 有时会使用ModuleName:ScriptModule抛出此消息

I have already wasted 2 days on this thing and I'm running out of ideas so any suggestions would be appreciated. 我已经在这件事上浪费了2天而且我已经没有想法了,所以任何建议都会受到赞赏。

Like any large generic problem, your best bet in diagnosing the issue is to figure out how to break down the issue into smaller parts, how to hypothesize the issues, and how to validate or invalidate your hypotheses. 与任何大型通用问题一样,诊断问题的最佳方法是弄清楚如何将问题分解为更小的部分,如何假设问题,以及如何验证或使您的假设无效。 My first inclination would be to hypothesize that the server-side processes in this particular are taking a long time, causing your client requests to block, making the whole thing seem frozen. 我的第一个倾向是假设这个特定的服务器端进程需要很长时间,导致客户端请求被阻塞,使整个事情看起来冻结。

From there, I would attempt to replicate the long running server side processes by creating isolated client side tests - perhaps if the URLs are HTTP gets, I would test the same URLs individually. 从那里,我将尝试通过创建隔离的客户端测试来复制长时间运行的服务器端进程 - 也许如果URL是HTTP获取,我将单独测试相同的URL。 If they were HTTP posts, I'd create an isolated test form if feasible to see what happens with each request. 如果它们是HTTP帖子,我会创建一个单独的测试表单,如果可行的话,看看每个请求会发生什么。 If a long running server side process is found then you have a starting point. 如果找到长时间运行的服务器端进程,那么您有一个起点。

If there are no long running server side processes then it may be JavaScript / client side coding issues that need to be looked into. 如果没有长时间运行的服务器端进程,则可能需要查看JavaScript /客户端编码问题。 But definitely when you're working a large, unfamiliar project, your best bet is to figure out how to break down the issue into smaller components that can then be tested 但是当你正在开展一个大型的,不熟悉的项目时,最好的办法就是找出如何将问题分解成更小的组件然后进行测试

I solved the issue finally. 我终于解决了这个问题。 Here is what I did: 这是我做的:

  1. Experimented with IIS settings and App_Pool recycling and noticed that there is nothing wrong with the way it handles requests that actually reach it. 使用IIS设置和App_Pool回收进行实验,并注意到它处理实际到达请求的方式没有任何问题。

  2. I focused on the Http.sys module and noticed that in the log files there were a lot of Timer_ConnectionIdle and Client_Reset errors. 我专注于Http.sys模块,并注意到在日志文件中有很多Timer_ConnectionIdle和Client_Reset错误。

  3. After some more experimentation and a lot of Google searches, I accidentally found this answer and it solved my issue. 经过一些更多的实验和大量的Google搜索,我意外地找到了这个答案 ,它解决了我的问题。 As the answer suggests the problem was caused by the AVG antivirus installed and incorrectly configured on the server. 由于答案表明问题是由安装AVG防病毒并在服务器上错误配置引起的。

Thanks for all the help and suggestions. 感谢所有的帮助和建议。

如果是导致浏览器冻结的ajax调用,请确保它们不blocking ajax调用。

Just appending to Shan's answer, which is a good one. 只是附上Shan的答案,这是一个很好的答案。

First off, there is obviously a code issue as this is by no means 'normal' behavior for IIS. 首先,显然存在代码问题,因为这绝不是IIS的“正常”行为。

That said, you must isolate it as Shan indicated. 也就是说,你必须像Shan指出的那样隔离它。 For example, given the server itself no longer accepts connections then we can pretty well eliminate javascript as the source of the problem and relegate it to being just a symptom. 例如,鉴于服务器本身不再接受连接,那么我们可以很好地消除javascript作为问题的根源并将其降级为仅仅是一种症状。

Typically when a worker process spins into space like this it is due to either an infinite loop or an issue where multiple threads are trying to lock the same resource. 通常,当工作进程像这样旋转到空间时,这是由于无限循环或多个线程试图锁定相同资源的问题。 I bet if you let it run long enough IIS itself will timeout, kill and restart the process. 我敢打赌,如果你让它运行得足够久,IIS本身就会超时,杀死并重启这个过程。

With that in mind you want to look for any type of multithreaded garbage (which I highly recommend you don't do in a web server) or for anything that indicates a tight infinite loop. 考虑到这一点,你要寻找的任何类型的多线程垃圾(我强烈建议你不要在Web服务器做)或任何指示紧无限循环。 A loop is going to become apparent if you execute the requests individually. 如果单独执行请求,循环将变得明显。 A multi-threaded issue will only show up if you happen to get a collision. 如果碰巧发生碰撞,只会出现多线程问题。

Run various performance counters on the web server. 在Web服务器上运行各种性能计数器。 Also, once it locks up, let it sit that way for awhile. 此外,一旦它锁定,让它坐下来一段时间。 Once IIS performs it's own reset on the worker process go look for indicators in the event log. 一旦IIS在工作进程上执行它自己的重置,请在事件日志中查找指示符。

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

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