简体   繁体   English

如何在ASP.Net网站中找到死锁

[英]How to find the deadlock in ASP.Net Website

I am using .Net 2.0 and my site seems to reach the deadlock state at certain period. 我正在使用.Net 2.0,我的网站似乎在某个时期达到了死锁状态。 It stops working until I recycle the application pool or change something in web.config file. 它将停止工作,直到我回收应用程序池或更改web.config文件中的内容。 I think deadlock is causing this issue. 我认为死锁导致了这个问题。

I am wondering if there is any tool to debug/check the site to find the code that could be causing the deadlock. 我想知道是否有任何工具来调试/检查网站,以找到可能导致死锁的代码。

Right now I had to set recycling interval to 10 minutes which is really bad but it is the only way to solve the problem and there is a lot of codes on the site and I need to find the problem. 现在我不得不将回收间隔设置为10分钟,这真的很糟糕,但这是解决问题的唯一方法,网站上有很多代码,我需要找到问题所在。 If I use DOS attack tool, can I find the page/code block that is causing this issue? 如果我使用DOS攻击工具,是否可以找到导致此问题的页面/代码块? If I can, what is the best tool to test it? 如果可以的话,测试它的最佳工具是什么?

Cheers! 干杯!

EDIT I tried to check the Event Logs and found the following warning. 编辑我试图检查事件日志,并发现以下警告。 I don't know if it is issue will keep digging now. 我不知道现在是否会继续挖掘问题。 Exception information: Exception type: HttpException Exception message: Request timed out. 异常信息:异常类型:HttpException异常消息:请求超时。

If you use the 'Failed Request Tracing' and it'll produce a nice output which will then tell you what is causing the error, down to the module level. 如果您使用“失败的请求跟踪”,它将产生一个很好的输出,然后告诉您导致错误的原因,直到模块级别。 This will then give you the first step into where it's breaking down. 这将为您提供进入故障的第一步。

Have a read of this article on iis.net → Troubleshooting Failed Requests Using Tracing in IIS 7 在iis.net上阅读本文→ 在IIS 7中使用跟踪对失败的请求进行故障排除

I would attach visual studio to IIS and break the debugger when a deadlock occurs. 我会将visual studio连接到IIS,并在发生死锁时中断调试器。 You can then inspect the call stack of the running threads. 然后,您可以检查正在运行的线程的调用堆栈。

Code Project has a nice article on how to do IIS remote debugging . Code Project有一篇关于如何进行IIS远程调试好文章

Of course, you can very well set up up a test machine with a local IIS and local Visual Studio .NET and do this without the need to remotely debug. 当然,您可以很好地设置具有本地IIS和本地Visual Studio .NET的测试计算机,并且无需远程调试即可完成此操作。

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

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