windows-server-2012 – RackSpace Cloud中IIS8和MSSQL 2012之间的随机连接失败

前端之家收集整理的这篇文章主要介绍了windows-server-2012 – RackSpace Cloud中IIS8和MSSQL 2012之间的随机连接失败前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
背景

多年来,我在一个服务器实例上托管了我的所有服务器功能,包括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地址,以及服务器期望连接的非标准端口.

这些“超时”发生在看似随机的存储过程中,包括数据库几乎没有开销的过程.

所有问题似乎都指向网络连接问题,但检查以下内容应该揭示一些线索.

检查并确认以下内容

>验证是否打开了正确的端口(1433)>检查数据库用户权限>尝试连续ping到/从sql服务器>检查Virtual Nic的电源/睡眠选项>查看RackSpace是否可以为您提供NIC的任何日志,服务器之间的网络通信[端口,子网等]>检查Windows日志和sql Server日志>打开sql MGMT Studio上的活动监视器然后尝试重现错误(正在运行的应用程序?)并监视活动监视器中的“最近的昂贵查询

猜你在找的Windows相关文章