Pendengar IOCP yang tidak menghasilkan

11

Adakah yang tahu apa yang ditunjukkan oleh "Pendengar IOCP yang tidak menghasilkan"?

Pada SQL Server kami baru saja melakukan dump bugcheck:

=====================================================================                                            
       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

Lansiran untuk pesan 'keterlambatan rata-rata' terkait dengan pencerminan basis data dan merupakan peringatan yang muncul ketika waktu yang diambil untuk melakukan transaksi melampaui waktu yang ditentukan. The is_event_loggedkolom 0 untuk 'rata-rata delay' peringatan.

Anda dapat melihat output dari sys.configurationspada. Apa yang dapat menyebabkan sesi mirroring timeout kemudian failover? .

Max Vernon
sumber

Jawaban:

9

IOCP adalah Port Penyelesaian I / O. Pendengar IOCP Non-Yielding berarti bahwa utas yang menangani rutin penyelesaian IO membutuhkan waktu yang relatif lama untuk melakukan sesuatu, dan SQLOS meskipun mungkin macet / macet / apa pun.

Sql server melakukan banyak ASYNC IO. Cara kerjanya adalah ketika mengirimkan permintaan IO ke OS, ia mengatakan "Lakukan IO ini secara tidak sinkron. Berikut ini adalah penunjuk fungsi untuk memanggil ketika sudah selesai."

Fungsi yang dipanggil adalah pendengar penyelesaian IO.

Pertimbangkan halaman yang dibaca dari disk. Utas yang menjalankan pilihan perlu membaca halaman yang tidak ada dalam memori. Dibutuhkan PAGEIOLATCH, mengeluarkan IO async ke windows untuk membaca halaman, dan pergi tidur.

Ketika OS menyelesaikan IO, ia memanggil fungsi IOCP yang menandai IO sebagai "selesai". Tak lama kemudian, utas sql menyelesaikan 4ms kuantumnya, dan memeriksa IO untuk ditangani. Ini menandai itu sebagai selesai dan memberi sinyal utas untuk bangun. Utas SELECT dijadwalkan, merilis PAGEIOLATCH, dan hidup itu baik.

Sekarang, jumlah pekerjaan yang IOCP lakukan bervariasi tergantung pada jenis IO yang terlibat. Saya percaya bahwa dengan DB Mirroring, itu berfungsi lebih banyak daripada jika hanya membaca halaman ke dalam buffer pool.

Jika Anda seorang programmer yang bekerja pada sql server, dan Anda ingin mengoptimalkan kode DB Mirroring, Anda mungkin tergoda untuk melakukan lebih banyak pekerjaan di jalur kode mirroring IOCP vs jalur kode thread sistem SQLOS.

Atau mungkin IOCP perlu menyalin data ke beberapa buffer mirroring yang berukuran tetap, dan itu duduk dalam satu lingkaran sampai selesai.

Atau mungkin <> terjadi, dan fungsi IOCP tampaknya "macet".

Saya tidak akan khawatir tentang ini jika itu terjadi selama failover dan banyak aktivitas LOG terjadi. Jika itu terjadi secara konsisten, maka mungkin perlu penyelidikan lebih lanjut.

StrayCatDBA
sumber