什么会导致asp.net停止响应 [英] what can cause asp.net to stop responding

查看:88
本文介绍了什么会导致asp.net停止响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个asp.net应用程序,该应用程序通过httpwebrequest大量使用REST/json服务,并大量使用Web缓存.似乎零星地,工作进程只是停止响应.浏览器坐在那里等待响应,但永远不会得到响应.只有重新启动应用程序池才能解决此问题.没有任何未处理的异常或我们注意到的任何其他异常. cpu和内存负载都很低(<10%cpu util,> 80%可用内存)

we have an asp.net application, that makes heavy use of REST/json services through httpwebrequest and heavy use of the web cache. seemingly sporadically, the worker process simply stops responding. the browser sits expecting a response and never gets one. only an app pool restart seems to remedy the problem. there are no unhandled exceptions or any other anomalies that we have noticed. cpu and memory loads are low (<10% cpu util, >80% free memory)

我们得到的唯一可能提示是,我们在事件日志中的某个时刻看到了检测到死锁"消息,但并不一致.此外,我们已经消除了我们认为是造成这种争用的唯一可能原因(通过begin/end请求执行多个并发的httpwebrequest).

the only possible hint that we have had is that we saw 'deadlock detected' messages in the event log at one point, but not consistently. additionally, we've eliminated what we think to be the only possible cause of such contention (executing multiple concurrent httpwebrequests via begin/end request).

有什么想法吗?

win 03服务器/数据中心版(在Amazon EC2上) asp.net 3.5

win 03 server/data center edition (on amazon ec2) asp.net 3.5

推荐答案

当您使用无响应的应用程序且CPU使用率较低时,很可能是并发问题.您或者具有导致所有线程停止的死锁,或者您的异步线程要花很长时间才能完成,并且ThreadPool最终会饿死.由于运行的是ASP.Net,因此应检查ThreadPool的运行情况.您可以观看性能计数器,或者更好地使用windbg附加到您的应用程序(可以从Windows调试工具

When you have a non-responsive application with low cpu used, it's most likely a concurrency issue. You either have deadlocks which cause all your threads to stall, or your asynchronous threads take forever to finish and the ThreadPool ends up starving. Since you're running ASP.Net, you should check how the ThreadPool is doing. You can watch the performance counters or, better, attach to your application with windbg (you can get it from Debugging Tools for Windows http://www.microsoft.com/whdc/DevTools/Debugging/default.mspx).

启动windbg,附加到asp.net进程,然后在命令提示符下:

Launch windbg, attach to the asp.net process and then, in the command prompt:

.loadby mscorwks sos
!ThreadPool

更好的是,下载sosex扩展名( http ://www.stevestechspot.com/CommentView,guid,9fdcf4a4-6e09-4807-bc31-ac1adf836f6c.aspx ),并使用

Even better, download the sosex extension (http://www.stevestechspot.com/CommentView,guid,9fdcf4a4-6e09-4807-bc31-ac1adf836f6c.aspx) and check for deadlocks with

!dlk

检查哪些线程被阻塞,切换到其中一个线程(使用UI或命令行)并输入

check what are the threads blocking, switch to one of the threads (using the UI or the command line) and type

!CLRStack

具有堆栈跟踪,向您显示哪个方法阻止了您的应用程序.

to have a stack trace showing you which method is blocking your application.

这篇关于什么会导致asp.net停止响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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