Ping.SendAsync使IIS陷入僵局 [英] Ping.SendAsync bringing IIS to a deadlock

查看:118
本文介绍了Ping.SendAsync使IIS陷入僵局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我有一个页面,每个设备发送4个异步Ping,并且在大多数情况下效果很好.但是,由于超时,当其中许多设备脱机时-ASP.NET停止响应整个Web应用程序(不仅是此页面),并且我收到W32SVC错误:

ISAPI``c:\ winnt \ microsoft.net \ framework \ v2.0.50727 \ aspnet_isapi.dll''报告自身为不健康,原因如下:``检测到死锁''.

http://support.microsoft.com/kb/821268 [

Hello,

I have a page that sends 4 Async Pings per device, and works well for the most part. However, due to timeout, when many of these devices are offline - ASP.NET stops responding for the entire Web App (not only this page), and I get an W32SVC error:

ISAPI ''c:\winnt\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll'' reported itself as unhealthy for the following reason: ''Deadlock detected''.

http://support.microsoft.com/kb/821268[^]

When all devices are online - no crash occurs, only when majority are offline, and each Async Ping needs to wait for a timeout. I believe what is happening here is too many worker threads are being created, and this is crashing IIS. Does any one have any suggestions on a way to resolve this? I have already tried the recommended settings in machine.config from the microsoft site, and that doesn''t seem to help.

推荐答案

您可以降低Ping.SendAsync最长为1000毫秒,也许将最大TTL降低为10.

也许您应该将同时Ping.SendAsync命令的数量限制为最多10个.当他们完成后,再拿下10个,依此类推?

我认为您在ThreadPoll中使用了所有可用线程,并在那里进行了死锁.然后IIS采取措施停止死锁并终止您的程序.
You can lower the timeout for the Ping.SendAsync to maximum 1000 ms and perhaps lower the maximum TTL to 10.

And perhaps you should limit number of simultaneous Ping.SendAsync commands to 10 max. And when they get completed take the next 10 and so on?

I think you use all available thread in the ThreadPoll, and there by making a deadlock. The IIS then then take action to stop the deadlock and terminates your program.


这篇关于Ping.SendAsync使IIS陷入僵局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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