이상한 간헐적 SQL 연결 오류, 재부팅 수정은 3-5 일 후에 돌아옵니다 (ASP.NET)

StackOverflow https://stackoverflow.com/questions/428846

문제

3-5 일마다 어떤 이유로 우리 웹 앱은 다음 오류로 DB에 대한 연결을 열 수있는 기능을 상실합니다. 이상한 일은 컨테이너를 재부팅하는 것입니다 (VPS). 정상적인 기능으로. 그런 다음 며칠 후에 다시 발생합니다. 그런 문제가있는 사람이 있습니까? 광고 서버에서 한밤중에 보안 로그에서 많은 익명 로그온이 이상하고 Amsterdam의 IP에서 많은 익명 로그온이 많이 발견되었습니다. 정확히 무엇을 의미하는지 또는 관련이 있는지 아닌지를 말하는 방법을 잘 모르겠습니다.

Server Error in '/ntsb' Application.
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)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Source Error:

Line 11:        
Line 12:        
Line 13:        dbConnection.Open()
Line 14:        
Line 15:        


Source File: C:\Inetpub\wwwroot\includes\connection.ascx    Line: 13

Stack Trace:

[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.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +248
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +245
   System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +475
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +260
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +2445449
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +2445144
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +354
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +703
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +54
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +2414696
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +92
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +1657
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +84
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +1645687
   System.Data.SqlClient.SqlConnection.Open() +258
   ASP.includes_connection_ascx.getConnection() in C:\Inetpub\wwwroot\includes\connection.ascx:13
   ASP.default_aspx.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\Default.aspx:16
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 
도움이 되었습니까?

해결책

SQL Server에 허용되는 연결 수는 고정 리소스입니다. 닫히지 않는 코드가 올바르게 연결되어있는 것처럼 들리며, 기간 후에는 더 이상 새로운 것을 열 수 없습니다.

다른 팁

우리는 최근에 우리의 생산 환경에서 비슷한 문제에 직면했으며, 많은 라운드의 "디버그 디아그"ging 및 덤프 분석 후에 우리는 크게 조각난 큰 물체 힙이 이것을 일으키고 있다는 결론에 도달했습니다. 심판 http://msdn.microsoft.com/en-us/magazine/cc534993.aspx. 요컨대, 응용 프로그램은 메모리가 부족했을 수 있으며 연결을 열 수있는 Contiguos 공간이 충분하지 않았습니다. vmmap을 사용할 수 있습니다 http://technet.microsoft.com/en-us/sysinternals/dd535533 사용 가능한 여유 공간을 식별 할 목적으로. 앱풀을 정기적으로 재활용하고 있습니까? AppPool Recycle은 응용 프로그램을 중단하고 도움을 받기 위해 모든 도움을 받아 관련 문제를 해결합니다.

Perfmon 및 Profiler (추적)로 기본 정보를 수집하여 얼마나 많은 연결이 만들어 졌는지, 메모리 통계 및 기타 흥미로운 것들을 확인해 보셨습니까?

"광고 서버에서 한밤중에 보안 로그에서 많은 익명 로그온이 이상하고 Amsterdam의 IP에서 많은 익명 로그온이 많이 발견되었습니다."

누군가가 당신의 시스템에 침입하려고 할 수있는 것처럼 들리며 아마도 이것은 닫히지 않는 연결 일 것입니다. 나는 Perfmon과 Profiler를 사용하여 문제를보기위한 제안을 좋아합니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top