我们有一个成熟的SQL Server 2008 R2服务器,从许多C#Web应用程序中使用,每个都有连接池。
昨天晚上,在问题解决之前,所有Web应用程序都无法login到数据库6分钟。 这是用于各种login。
我查看了服务器上的事件日志,发现了很多消息:
The client was unable to reuse a session with SPID [Various], which had been reset for connection pooling. The failure ID is 29. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.
在错误消息之前,我找不到一个失败的操作。 29的失败ID显然是指RedoLoginException 。
事件日志中也有很多这样的内容:
Login failed for user '[Various]'. Reason: Failed to open the database configured in the login object while revalidating the login on the connection.
还有一些暂停:
A timeout (30000 milliseconds) was reached while waiting for a transaction response from the MSSQLSERVER service. Timeout occurred while waiting for latch: class 'DBCC_MULTIOBJECT_SCANNER' id ..., type 4, Task ...: 44, waittime 300, flags 0x1a, owning task .... Continuing to wait. Timeout occurred while waiting for latch: class 'ACCESS_METHODS_DATASET_PARENT', ...
和:
IO Completion Listener (0x900) Worker ... appears to be non-yielding on Node 1. Approx CPU Used: kernel 0ms, user 0ms, Interval; 15334
从客户端Web服务器的angular度来看,他们收到了一些login错误:
Logon failure: the user has not been granted the requested logon type at this computer Logon Failure: The target account name is incorrect Logon failure: unknown user name or bad password
我想知道线程池,并发现max worker threads被设置为0。
有任何想法吗?
更新:现在已经发生了三次。
这很可能与客户端的连接方法和MSSQL的连接池有关。 该应用程序可能需要更新连接string或它是非常特定于您的整体设置。 你可以看看这里https://dba.stackexchange.com/questions/41820/connection-pools-being-reset-with-error-18056- severity-20-state-46-perfm 。
顺便说一句,如果你有MSSQL的特定错误描述,每个人都可以更容易地给出答案。
希望这有助于。