Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated

后端 未结 20 2496
臣服心动
臣服心动 2020-11-22 10:23

I have many users on my web site (20000-60000 per day), which is a download site for mobile files. I have remote access to my server (windows server 2008-R2).
I\'ve

20条回答
  •  感动是毒
    2020-11-22 10:57

    While all the earlier responses address the issue they did not cover all cases.

    Microsoft has acknowledged the issue and fixed it in 2011 for supported operating systems, so if you get the stack trace like:

    Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
    at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
    at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
    

    you may need to update your .NET assemblies.

    This issue occurs because of an error in the connection-retry algorithm for mirrored databases.

    When the retry-algorithm is used, the data provider waits for the first read (SniReadSync) call to finish. The call is sent to the back-end computer that is running SQL Server, and the waiting time is calculated by multiplying the connection time-out value by 0.08. However, the data provider incorrectly sets a connection to a doomed state if a response is slow and if the first SniReadSync call is not completed before the waiting time expires.

    See KB 2605597 for details

    https://support.microsoft.com/kb/2605597

提交回复
热议问题