I am doing some performance investigations in a database.
Two servers with synchronous database mirroring between two data centers.
A simple stored procedure with one insert statement (auto-commit transaction).
Most of the time (95% of the time) the stored procedure takes 2 ms to execute (measured using the module_end extended event).
Sometimes the stored procedure takes longer time to execute, 3 - 50 ms.
I can see that all the time goes in the DBMIRROR_DBM_EVENT wait extended event when it is slow.
I am trying to figure out how to trace this further, to find out if the problem is with the network, the mirror server, or something else.
I am thinking about if I could look at extended events on the mirror server and correlate that. Is there a way to see the principal's sessionid's on wait events on the mirror server? Are there some other events that could be useful?
I am grateful for all ideas.
Ola Hallengren
http://ola.hallengren.com