背景
原文链接:https://www.f2er.com/windows/366464.html多年来,我在一个服务器实例上托管了我的所有服务器功能,包括IIS,Apache,MySql和MSsql,哎!随着我的客户端增长,这导致服务器忙碌时持久的sql超时.在过去的一年里,我将其重组为三台服务器,一台用于IIS .Net 4的Windows Server 2012,一台用于Apache的CentOS实例,以及一台仅用于MSsql 2012的Windows Server 2012.这些服务器都是RackSpace云中的虚拟实例,除了一件事之外,它似乎运行顺畅……
sqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
要么
System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
我理解这些并处理过它们,我一般都不再理解它们了.
问题
我得到的是一种完全不同类型的超时错误,似乎与网络相关,例如…
[sqlException: A network-related or instance-specific error occurred while establishing a connection to sql Server. The server was not found or was not accessible. Verify that the instance name is correct and that sql Server is configured to allow remote connections. (provider: TCP Provider,error: 0 - A connection attempt Failed because the connected party did not properly respond after a period of time,or established connection Failed because connected host has Failed to respond.)]
和
[Win32Exception: The specified network name is no longer available] [sqlException: A transport-level error has occurred when receiving results from the server. (provider: TCP Provider,error: 0 - The specified network name is no longer available.)]
和
System.ComponentModel.Win32Exception (0x80004005): The semaphore timeout period has expired System.Data.sqlClient.sqlException (0x80131904): A transport-level error has occurred when receiving results from the server. (provider: TCP Provider,error: 0 - The semaphore timeout period has expired.)
和
System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out System.Data.sqlClient.sqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
和
System.ComponentModel.Win32Exception (0x80004005): A connection attempt Failed because the connected party did not properly respond after a period of time,or established connection Failed because connected host has Failed to respond
也许部分区别在于IIS8比以前的版本给我更具体的错误消息(是吗?)……但是这些错误中的一些似乎是这两个Windows Server 2012实例之间的基本通信问题.我还注意到一些轶事证据,我的FTP客户端定期无法连接到Web服务器,并且Windows网络共享似乎间歇性地断开连接.
所以我被困在一个我有一台油井机的地方,每天都会让我莫名其妙地失败几次.因为我更像是一名开发人员而不是DBA或服务器管理员…我很困惑.
我的连接字符串总是这样……
SERVER=LiveDatabase;DATABASE=DataBaseName;UID=userid;PWD=pwd;Pooling=true;Min Pool Size=10;Max Pool Size=500;Connect Timeout=10;
其中LiveDatabase是计算机sql Server Native Client配置中的别名设置.然后,Alias指向RackSpace专用网络192.168.x.x中的本地IP地址,以及服务器期望连接的非标准端口.