DBMIRRORING_CMD Wait Type in SQL Server

⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: HADR_SYNC_COMMIT Wait TypeRelated pillar: High Availability

Is It a Problem?

Usually not. It is typical background on any mirrored instance and is commonly filtered as benign. Get Wait Statistics does not filter it out, so if it ranks, you will see it.


What It Means

Microsoft describes it as a task waiting for log records to be flushed to disk, and says this wait is expected to be held for long periods. More broadly, it is waiting for database mirroring configuration and state changes, including log flushes, for example during an ALTER DATABASE. Either way it is mirroring plumbing rather than one operation.


When It Does Matter

Only in one situation, and that one is anecdotal: if it is among your most prevalent waits and mirroring is slow, look at the log write latency on the mirror server, where the mirror database’s log file lives. Get Database IO Usage shows read and write stalls per file; the baseline to monitor is the mirror’s log write latency against the principal’s. Otherwise, filter it out.


The DBMIRROR Family

These are the database mirroring waits. Mirroring is deprecated in favour of Availability Groups, and most of these are idle queues that tick over on any mirrored instance. The one that costs users time is DBMIRROR_SEND; for the Availability Group equivalent, see HADR_SYNC_COMMIT.

  • HADR_SYNC_COMMITThe AG equivalent. The primary waiting for a synchronous secondary, the wait mirroring migrations move to.The main page for this family
  • DBMIRROR_SENDNetwork backlog. Waiting for the network layer backlog to clear before sending mirroring messages.Worth a look when it climbs
  • DBMIRRORING_CMDLog flush. Waiting for log records to be flushed to disk; expected to be held for long periods.Usually noise. This page.
  • DBMIRROR_WORKER_QUEUEIdle workers. A mirroring worker task waiting for more work.Usually noise
  • DBMIRROR_EVENTS_QUEUEIdle events. Mirroring waiting for events to process.Usually noise
  • DBMIRROR_DBM_MUTEXMirror redo. Documented for information only; on the mirror, waiting for parallel redo threads.Usually noise

Where To Go Next

DBMIRRORING_CMD is background noise on a mirrored instance. If you are chasing a real problem, start with the waits that cost you time.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *