lowDatabase Mirroring

DBMIRROR_DBM_EVENT Wait Type Explained

DBMIRROR_DBM_EVENT is a benign SQL Server wait type from database mirroring background monitoring. Learn why it's safe to filter from wait stats analysis.

Quick Answer

DBMIRROR_DBM_EVENT is a benign background wait type generated by database mirroring's internal event monitoring system, even when mirroring is not actively configured. This wait appears in sys.dm_os_wait_stats as the mirroring subsystem checks for events and can be safely filtered from wait statistics analysis since it represents normal SQL Server background activity, not performance bottlenecks.

Root Cause Analysis

The database mirroring subsystem initializes during SQL Server startup and maintains an internal event monitoring thread regardless of whether any databases are actually configured for mirroring. This background thread periodically checks for mirroring-related events using an internal wait mechanism that surfaces as DBMIRROR_DBM_EVENT waits.

The wait occurs when the mirroring event monitor thread sleeps between polling intervals, typically waiting on internal synchronization objects within the database mirroring manager. Since SQL Server 2012, this behavior remained consistent across versions through SQL Server 2022, with the subsystem maintaining this background thread even on instances that have never used database mirroring.

These waits accumulate continuously at low frequency and represent the normal idle state of the mirroring event system. The wait count increases slowly over time, but the total wait time remains minimal since each individual wait is brief. This pattern distinguishes benign background waits from performance-impacting waits that show high wait times relative to their occurrence count.

AutoDBA checks automated benign wait filtering, actionable performance bottleneck identification, and wait statistics analysis across your entire SQL Server instance in 60 seconds. Download the free diagnostic script and see what else needs attention.

Diagnostic Queries

-- Check current DBMIRROR_DBM_EVENT wait statistics
SELECT 
    wait_type,
    waiting_tasks_count,
    wait_time_ms,
    max_wait_time_ms,
    signal_wait_time_ms,
    wait_time_ms / NULLIF(waiting_tasks_count, 0) AS avg_wait_time_ms
FROM sys.dm_os_wait_stats 
WHERE wait_type = 'DBMIRROR_DBM_EVENT';

-- Verify this wait has minimal performance impact compared to actionable waits
WITH FilteredWaits AS (
    SELECT wait_type, wait_time_ms, waiting_tasks_count
    FROM sys.dm_os_wait_stats
    WHERE wait_type NOT IN (
        'DBMIRROR_DBM_EVENT', 'BROKER_EVENTHANDLER', 'BROKER_RECEIVE_WAITFOR',
        'BROKER_TASK_STOP', 'BROKER_TO_FLUSH', 'BROKER_TRANSMITTER',
        'CHECKPOINT_QUEUE', 'CHKPT', 'CLR_AUTO_EVENT', 'CLR_MANUAL_EVENT',
        'CLR_SEMAPHORE', 'DBMIRROR_DBM_MUTEX', 'DBMIRROR_EVENTS_QUEUE',
        'DBMIRROR_WORKER_QUEUE', 'DBTABLE', 'DIRTY_PAGE_POLL',
        'DISPATCHER_QUEUE_SEMAPHORE', 'EXECSYNC', 'FSAGENT',
        'FT_IFTS_SCHEDULER_IDLE_WAIT', 'FT_IFTSHC_MUTEX', 'HADR_CLUSAPI_CALL',
        'HADR_FILESTREAM_IOMGR_IOCOMPLETION', 'HADR_LOGCAPTURE_WAIT',
        'HADR_NOTIFICATION_DEQUEUE', 'HADR_TIMER_TASK', 'HADR_WORK_QUEUE',
        'KSOURCE_WAKEUP', 'LAZYWRITER_SLEEP', 'LOGMGR_QUEUE',
        'MEMORY_ALLOCATION_EXT', 'ONDEMAND_TASK_QUEUE',
        'PARALLEL_REDO_DRAIN_WORKER', 'PARALLEL_REDO_LOG_CACHE',
        'PARALLEL_REDO_TRAN_LIST', 'PARALLEL_REDO_WORKER_SYNC',
        'PARALLEL_REDO_WORKER_WAIT_WORK', 'PREEMPTIVE_XE_GETTARGETSTATE',
        'PWAIT_ALL_COMPONENTS_INITIALIZED', 'PWAIT_DIRECTLOGCONSUMER_GETNEXT',
        'QDS_PERSIST_TASK_MAIN_LOOP_SLEEP', 'QDS_ASYNC_QUEUE',
        'QDS_CLEANUP_STALE_QUERIES_TASK_MAIN_LOOP_SLEEP', 'QDS_SHUTDOWN_QUEUE',
        'REDO_THREAD_PENDING_WORK', 'REQUEST_FOR_DEADLOCK_SEARCH',
        'RESOURCE_QUEUE', 'SERVER_IDLE_CHECK', 'SLEEP_BPOOL_FLUSH',
        'SLEEP_DBSTARTUP', 'SLEEP_DCOMSTARTUP', 'SLEEP_MASTERDBREADY',
        'SLEEP_MASTERMDREADY', 'SLEEP_MASTERUPGRADED', 'SLEEP_MSDBSTARTUP',
        'SLEEP_SYSTEMTASK', 'SLEEP_TASK', 'SLEEP_TEMPDBSTARTUP',
        'SNI_HTTP_ACCEPT', 'SP_SERVER_DIAGNOSTICS_SLEEP', 'SQLTRACE_BUFFER_FLUSH',
        'SQLTRACE_INCREMENTAL_FLUSH_SLEEP', 'SQLTRACE_WAIT_ENTRIES',
        'WAIT_FOR_RESULTS', 'WAITFOR', 'WAITFOR_TASKSHUTDOWN', 'WAIT_XTP_RECOVERY',
        'WAIT_XTP_HOST_WAIT', 'WAIT_XTP_OFFLINE_CKPT_NEW_LOG', 'WAIT_XTP_CKPT_CLOSE',
        'XE_DISPATCHER_JOIN', 'XE_DISPATCHER_WAIT', 'XE_LIVE_TARGET_TVF',
        'XE_TIMER_EVENT'
    )
    AND wait_time_ms > 0
)
SELECT TOP 10
    wait_type,
    wait_time_ms,
    waiting_tasks_count,
    wait_time_ms / NULLIF(waiting_tasks_count, 0) AS avg_wait_time_ms
FROM FilteredWaits
ORDER BY wait_time_ms DESC;

Prevention

No prevention is required since DBMIRROR_DBM_EVENT represents normal SQL Server operation. The mirroring subsystem's background monitoring cannot and should not be disabled, as it maintains readiness for potential mirroring configuration regardless of current usage.

Modern monitoring tools like AutoDBA automatically exclude benign waits from performance analysis, allowing DBAs to focus on actionable wait types that indicate genuine bottlenecks. Manual wait statistics queries should always include comprehensive benign wait filters to avoid false performance concerns.

Need hands-on help?

Dealing with persistent dbmirror_dbm_event issues across your environment? Samix Technology provides hands-on SQL Server performance consulting with 15+ years of production DBA experience.

Related Pages