.net 信号量超时时间
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/551282/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Semaphore Timeout Period
提问by erick.brower
I've recently wiped and reinstalled/configured all the components of my web and DB servers. I'm running IIS 6, .NET 3.5, SQL Server 2005. The two servers are separate VM's in the same domain. My web app functions perfectly... 90% of the time. But every now and then I get this error or a generic runtime error:
我最近擦除并重新安装/配置了我的 Web 和数据库服务器的所有组件。我正在运行 IIS 6、.NET 3.5、SQL Server 2005。两台服务器是同一个域中的独立 VM。我的网络应用程序运行完美...... 90% 的时间。但我时不时地收到此错误或通用运行时错误:
System.Data.SqlClient.SqlException: A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The semaphore timeout period has expired.)
System.Data.SqlClient.SqlException:从服务器接收结果时发生传输级错误。(提供者:TCP 提供者,错误:0 - 信号量超时期限已过期。)
Can you guys give me some leads on where to start troubleshooting? I really think I've missed something in IIS.
你们能给我一些关于从哪里开始故障排除的线索吗?我真的认为我在 IIS 中遗漏了一些东西。
Thanks in advance!
提前致谢!
采纳答案by erick.brower
After troubleshooting this for hours and sitting on the phone with my hosting group they discovered that there was a problem with their networking configuration. The solution was made clearer when during my testing one of the VM's suddenly couldn't find the domain, and a simple 'ping' to the IP of each box from the other would occasionally time out. This ruled out DNS entirely. After the hosting group applied the proper configuration on their end the app has been stable and FAST!
经过几个小时的故障排除并与我的托管组坐在电话上后,他们发现他们的网络配置存在问题。在我测试期间,当一个 VM 突然找不到域时,解决方案变得更加清晰,并且从另一个 VM 到每个框的 IP 的简单“ping”偶尔会超时。这完全排除了 DNS。在托管组应用正确的配置后,应用程序稳定且快速!
Thanks for everyone's help!
感谢大家的帮助!
回答by Sam Saffron
Well I would start by ensuring I'm running the latest version of my virtual machine's network drivers.
好吧,我首先要确保我运行的是最新版本的虚拟机网络驱动程序。
Sounds like comms is failing between your 2 VMS. Try opening a TCP socket between the two machines and see if it dies after a certain amount of time.
听起来您的 2 个 VMS 之间的通信失败了。尝试在两台机器之间打开一个 TCP 套接字,看看它是否在一段时间后死掉。
回答by Learning
回答by renegadeMind
Can you double check the load on the db server? We do get them once in a while in our dev env, but never in the prod env.
你能仔细检查数据库服务器上的负载吗?我们偶尔会在我们的开发环境中获得它们,但从未在生产环境中获得它们。
回答by Liju
check whether the stored procedure has any line SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
检查存储过程是否有任何行 SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
For me this was the issue
对我来说这就是问题
回答by Ted Krapf
Late to the game, but I was getting this same error with a .NET web app/MS SQL. Site hosted in IIS on GoDaddy VPS, hosting has multiple IPs, DB hosted at Azure.
游戏迟到了,但我在使用 .NET Web 应用程序/MS SQL 时遇到了同样的错误。站点托管在 GoDaddy VPS 上的 IIS 中,托管有多个 IP,DB 托管在 Azure。
I believe my problem was (idiot!), I simply forgot to put the GD site's dedicated IP addresses from GD into the Azure firewall for the SQL server. For some strange reason the traffic gets to/from GD/Azure outside of the actual IP address for the website (the IIS binding addresses) and works.
我相信我的问题是(白痴!),我只是忘记将 GD 站点的专用 IP 地址从 GD 放入 SQL 服务器的 Azure 防火墙中。由于某些奇怪的原因,流量在网站的实际 IP 地址(IIS 绑定地址)之外进出 GD/Azure 并且可以正常工作。
But more often than not the actual IIS binding addresses are the ones calling out to Azure to interact with the SQL services. I corrected the firewall settings on Azure to include the correct IPs from GoDaddy and (knock on wood) the semaphore error seems gone now.
但通常情况下,实际的 IIS 绑定地址是调用 Azure 与 SQL 服务交互的地址。我更正了 Azure 上的防火墙设置以包含来自 GoDaddy 的正确 IP,并且(敲木头)信号量错误现在似乎消失了。
In other words, before you start looking for big problems, start simple and be sure to check easy things like network/firewall settings.
换句话说,在你开始寻找大问题之前,先从简单开始,并确保检查简单的事情,比如网络/防火墙设置。
回答by Ramon Araujo
I will post my experience just in case it might help someday somebody ;)
我会发布我的经验,以防有一天它可能对某人有所帮助;)
At the end of the year, just trying to connect remotely to our servers from a place far, far away, using my phone. I noticed that I could not login to one windows server via remote desktop (black screen), nor I could connect from a Windows Application to the same server.
年底,我只是想用我的手机从很远很远的地方远程连接到我们的服务器。我注意到我无法通过远程桌面(黑屏)登录到一台 Windows 服务器,也无法从 Windows 应用程序连接到同一台服务器。
As soon as I changed from my phone to a different connection (via a NightHawk M1 mobile router), it was all good.
一旦我将手机更改为不同的连接(通过 NightHawk M1 移动路由器),一切都很好。
As I have read, is is about NETWORKING issues mainly, so DO NOT PANIC and try to find the guilty there.
正如我所读到的,主要是关于网络问题,所以不要恐慌并尝试在那里找到罪魁祸首。
Hope it helps, R
希望它有帮助,R

