背景
多年来,我在单个服务器实例中托pipe了我所有的服务器function,包括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.
我理解这些,并处理了他们,我通常不会再得到他们了。
问题
我所得到的是一种完全不同的超时错误,似乎是networking相关的,如…
[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服务器,并且Windowsnetworking共享似乎断断续续地断开连接。
所以我被困在一个地方,那里有一台润滑良好的机器,每天都会令我无数次失败。 由于我比DBA或服务器pipe理员更像一个开发人员…我很困惑。
我的连接string总是这样的…
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 Clientconfiguration中的别名设置。 然后,别名指向RackSpace专用networking192.168.xx中的本地IP地址,以及服务器期望连接的非标准端口。
这些“超时”发生在看似随意的存储过程上,包括对数据库几乎没有开销的过程。
所有的问题似乎都指向networking连接问题,但检查以下应该显示一些线索。
检查并确认以下内容: