Ouvinte IOCP não produtivo

11

Alguém sabe o que "Ouvinte IOCP não produtivo" indica?

Um dos nossos servidores SQL tinha apenas um despejo de verificação de bug:

=====================================================================                                            
       BugCheck Dump                                                                                             
=====================================================================                                            

This file is generated by Microsoft SQL Server                                                                   
version 9.00.5292.00                                                                                             
upon detection of fatal unexpected error. Please return this file,                                               
the query or program that produced the bugcheck, the database and                                                
the error log, and any other pertinent information with a Service Request.                                       


Computer type is AT/AT COMPATIBLE.                                                                               
Bios Version is DELL   - 1                                                                                       
Phoenix ROM BIOS PLUS Version 1.10 1.5.2                                                                         
Current time is 23:01:04 09/07/12.                                                                               
48 Unknown CPU 9., 2 Mhz processor (s).                                                                          
Windows NT 6.1 Build 7601 CSD Service Pack 1.                                                                    

Memory                               
MemoryLoad = 81%                     
Total Physical = 524278 MB           
Available Physical = 97549 MB        
Total Page File = 524276 MB          
Available Page File = 94472 MB       
Total Virtual = 8388607 MB           
Available Virtual = 7846765 MB       
**Dump thread - spid = 0, PSS = 0x0000000000000000, EC = 0x0000000000000000                                      
***Stack Dump being sent to C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\SQLDump0008.txt              
* *******************************************************************************                                
*                                                                                                                
* BEGIN STACK DUMP:                                                                                              
*   09/07/12 23:01:04 spid 0                                                                                     
*                                                                                                                
* Non-yielding IOCP Listener                                                                                     
*                                                                                                                
* *******************************************************************************             </pre>                   


SQLDump0008.log contains:

<pre>
 No user action is required.
2012-09-07 18:30:11.28 spid782     Recovery of any in-doubt distributed transactions involving Microsoft Distributed Transaction Coordinator (MS DTC) has completed. This is an informational message only. No user action is required.
2012-09-07 20:58:54.53 spid196     The alert for 'average delay' has been raised. The current value of '509' surpasses the threshold '100'.
2012-09-07 20:59:24.74 spid477     The alert for 'average delay' has been raised. The current value of '299' surpasses the threshold '100'.
2012-09-07 21:44:06.53 spid23s     Database mirroring is inactive for database 'ToDoLists'. This is an informational message only. No user action is required.
2012-09-07 21:44:06.59 spid456     The alert for 'average delay' has been raised. The current value of '518' surpasses the threshold '100'.
2012-09-07 21:44:57.98 spid425     Error: 18056, Severity: 20, State: 27.
2012-09-07 21:44:57.98 spid425     The client was unable to reuse a session with SPID 425, which had been reset for connection pooling. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.
2012-09-07 21:44:57.98 spid808     Error: 18056, Severity: 20, State: 27.
2012-09-07 21:44:57.98 spid808     The client was unable to reuse a session with SPID 808, which had been reset for connection pooling. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.
2012-09-07 21:44:58.01 spid155     Error: 18056, Severity: 20, State: 27.
2012-09-07 21:44:58.01 spid155     The client was unable to reuse a session with SPID 155, which had been reset for connection pooling. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.
2012-09-07 21:44:58.03 spid486     Task (Worker 0x00000001B93B21C0) was forced to yield 2 times: 
2012-09-07 21:44:58.04 spid65s     Database mirroring is inactive for database 'Tracking'. This is an informational message only. No user action is required.
2012-09-07 21:44:58.06 spid486     Task (Worker 0x0000000CB9B341C0) was forced to yield 8 times: 
2012-09-07 21:44:58.09 spid486     Task (Worker 0x0000000655A9E1C0) was forced to yield 3 times: 
2012-09-07 21:44:58.10 spid486     Task (Worker 0x00000006C03BE1C0) was forced to yield 8 times: 
2012-09-07 21:44:58.11 spid65s     Error: 1404, Severity: 16, State: 6.
2012-09-07 21:44:58.11 spid65s     The command failed because the database mirror is busy. Reissue the command later.
2012-09-07 21:44:58.11 spid486     Task (Worker 0x0000000C819D01C0) was forced to yield 2 times: 
2012-09-07 21:44:58.49 spid140     The alert for 'average delay' has been raised. The current value of '191' surpasses the threshold '100'.
2012-09-07 21:45:00.66 spid46s     SQL Server has encountered 6 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2012-09-07 21:45:17.25 spid83s     SQL Server has encountered 6 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2012-09-07 21:45:17.25 spid54s     SQL Server has encountered 6 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2012-09-07 21:45:17.28 spid45s     The mirrored database "Tracking" is changing roles from "PRINCIPAL" to "MIRROR" due to Role Syncronization.
2012-09-07 21:45:17.61 spid46s     Bypassing recovery for database 'Tracking' because it is marked as a mirror database, which cannot be recovered. This is an informational message only. No user action is required.
2012-09-07 21:45:29.21 spid45s     Database mirroring is active with database 'Tracking' as the mirror copy. This is an informational message only. No user action is required.
2012-09-07 21:50:56.94 spid196s    SQL Server has encountered 5 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2012-09-07 21:50:57.14 spid196s    SQL Server has encountered 5 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2012-09-07 21:50:57.14 spid196s    SQL Server has encountered 5 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2012-09-07 23:00:09.42 spid438     Error: 18056, Severity: 20, State: 27.
2012-09-07 23:00:09.42 spid438     The client was unable to reuse a session with SPID 438, which had been reset for connection pooling. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.
2012-09-07 23:01:04.26 Server      Using 'dbghelp.dll' version '4.0.5'
2012-09-07 23:01:04.29 Server      **Dump thread - spid = 0, PSS = 0x0000000000000000, EC = 0x0000000000000000
2012-09-07 23:01:04.29 Server      ***Stack Dump being sent to C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\SQLDump0008.txt
2012-09-07 23:01:04.29 Server      * *******************************************************************************
2012-09-07 23:01:04.29 Server      *
2012-09-07 23:01:04.29 Server      * BEGIN STACK DUMP:
2012-09-07 23:01:04.29 Server      *   09/07/12 23:01:04 spid 0
2012-09-07 23:01:04.29 Server      *
2012-09-07 23:01:04.29 Server      * Non-yielding IOCP Listener
2012-09-07 23:01:04.29 Server      *
2012-09-07 23:01:04.29 Server      * *******************************************************************************
2012-09-07 23:01:04.29 Server      * -------------------------------------------------------------------------------
2012-09-07 23:01:04.29 Server      * Short Stack Dump
2012-09-07 23:01:04.33 spid73      The alert for 'average delay' has been raised. The current value of '304' surpasses the threshold '100'.
2012-09-07 23:01:04.34 Server      Stack Signature for the dump is 0x00000000000002E8

O alerta para a mensagem 'atraso médio' refere-se ao espelhamento do banco de dados e é um alerta gerado quando o tempo gasto para confirmar as transações ultrapassa o tempo especificado. A is_event_loggedcoluna é 0 para o alerta 'atraso médio'.

Você pode ver a saída sys.configurationsem O que pode causar o tempo limite de uma sessão de espelhamento e o failover? .

Max Vernon
fonte

Respostas:

9

IOCP é uma porta de conclusão de E / S. Um ouvinte IOCP sem rendimento significa que o encadeamento que lida com as rotinas de conclusão de E / S demorou (relativamente) muito tempo para fazer alguma coisa e o SQLOS, embora possa estar travado / travado / o que for.

Servidor SQL faz muito ASYNC IO. A maneira como funciona é quando ele envia a solicitação de entrada / saída para o sistema operacional e diz: "Faça essa entrada / saída de forma assíncrona. Aqui está um ponteiro de função para chamar quando terminar".

A função que é chamada é o ouvinte de conclusão de E / S.

Considere uma página lida no disco. Um thread executando um select precisa ler uma página que não está na memória. É necessário um PAGEIOLATCH, emite o IO assíncrono no Windows para ler a página e entra em suspensão.

Quando o sistema operacional conclui o IO, ele chama a função IOCP que sinaliza o IO como "concluído". Logo depois, um thread sql termina seu quantum de 4ms e verifica se as E / S são manipuladas. Ele sinaliza como concluído e sinaliza para o segmento emissor ativar. O encadeamento SELECT é agendado, libera o PAGEIOLATCH e a vida é boa.

Agora, a quantidade de trabalho que o IOCP realiza varia de acordo com o tipo de E / S envolvido. Acredito que, com o DB Mirroring, ele funcione mais do que faria se estivesse apenas lendo uma página no buffer pool.

Se você é um programador trabalhando no servidor sql e deseja otimizar o código de espelhamento de banco de dados, pode se sentir tentado a colocar mais trabalho no caminho do código de espelhamento IOCP versus o caminho do código de encadeamento do sistema SQLOS.

Ou talvez o IOCP precise copiar os dados em algum buffer de espelhamento de tamanho fixo e fique em loop até que esteja pronto.

Ou talvez <> aconteça, e a função IOCP parece "travada".

Eu não me preocuparia se isso acontecesse durante um failover e acontecesse muita atividade de LOG. Se isso acontecer de forma consistente, poderá ser necessária uma investigação mais aprofundada.

StrayCatDBA
fonte