Jim*_*der 5 iis connection sql-server-2008
服务器 1:SQL Server 2008 标准版 服务器 2:Windows 2008 Server R2、IIS 7.0
服务器 2 上的网站需要服务器 1 上的 SQL Server 中的数据。
一切都工作正常一段时间(有时是几周)。然后,在高负载下,服务器 2 报告它无法连接服务器 1 上的 SQL Server。一旦服务器 2 上的 IIS 报告它无法连接到服务器 1 上的 SQL,直到重新启动服务器 2 上的 IIS 后,情况才会好转。也许重新启动应用程序池和完全重置 IIS 一样有效。我不确定。
我尝试更改连接字符串以将连接池大小增加到不合理的大值(1,000)。失败仍然时有发生。
该网站是用 C# 编写的。数据访问层是NHibernate。
这是异常的开始:
[SqlException (0x80131904): 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +428
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
System.Data.SqlClient.SqlConnection.Open() +122
NHibernate.Connection.DriverConnectionProvider.GetConnection() +60
NHibernate.Impl.SessionFactoryImpl.OpenConnection() +39
Run Code Online (Sandbox Code Playgroud)
有什么想法为什么会发生这种情况吗?如何诊断/修复它?我很沮丧,正在考虑放弃 NHibernate,这将需要几个月的时间,并且可能会导致许多其他类型的问题。
| 归档时间: |
|
| 查看次数: |
1761 次 |
| 最近记录: |