Quick Answer
LOGMGR_QUEUE occurs when SQL Server's log writer task waits for new work requests to write transaction log records to disk. This is a benign background wait that indicates the log writer is idle, waiting for transactions to generate log activity. This wait should be filtered from wait statistics analysis as it represents normal system behavior, not a performance bottleneck.
Root Cause Analysis
The log writer task runs continuously as a background process, responsible for flushing transaction log records from the log buffer cache to the physical transaction log file. When no transactions are generating log records or when the log writer has caught up with all pending log writes, it enters a wait state on the LOGMGR_QUEUE.
This wait occurs in the log manager subsystem when the log writer thread calls into the scheduler to wait for work. The log writer maintains an internal queue of log flush requests, and when this queue is empty, the thread waits on LOGMGR_QUEUE until new log records need to be written or a checkpoint operation requires log hardening.
SQL Server 2016 and later versions show this wait more prominently in sys.dm_os_wait_stats due to improved telemetry, but the underlying mechanism remains consistent across versions. The wait accumulates during periods of low transaction activity, idle connections, or when the log writer efficiently keeps pace with transaction log generation.
Unlike performance-related waits, LOGMGR_QUEUE represents optimal behavior where the log writer is available and responsive to flush requests immediately when transactions commit.
AutoDBA checks benign wait filtering, log writer performance monitoring, and transaction log health checks across your entire SQL Server instance in 60 seconds. Download the free diagnostic script and see what else needs attention.
Diagnostic Queries
-- Check LOGMGR_QUEUE waits compared to total waits
SELECT
wait_type,
waiting_tasks_count,
wait_time_ms,
max_wait_time_ms,
signal_wait_time_ms,
CAST(wait_time_ms * 100.0 / SUM(wait_time_ms) OVER() AS DECIMAL(5,2)) AS wait_percentage
FROM sys.dm_os_wait_stats
WHERE wait_type = 'LOGMGR_QUEUE'
ORDER BY wait_time_ms DESC;
-- Query showing proper benign wait filtering
SELECT
wait_type,
waiting_tasks_count,
wait_time_ms,
max_wait_time_ms,
CAST(wait_time_ms * 100.0 / SUM(wait_time_ms) OVER() AS DECIMAL(5,2)) AS wait_percentage
FROM sys.dm_os_wait_stats
WHERE wait_type NOT IN (
'LOGMGR_QUEUE', 'CLR_SEMAPHORE', 'LAZYWRITER_SLEEP',
'RESOURCE_QUEUE', 'SLEEP_TASK', 'SLEEP_SYSTEMTASK',
'SQLTRACE_BUFFER_FLUSH', 'WAITFOR', 'XE_DISPATCHER_WAIT',
'XE_TIMER_EVENT', 'BROKER_TASK_STOP', 'CHECKPOINT_QUEUE',
'REQUEST_FOR_DEADLOCK_SEARCH', 'SLEEP_BPOOL_FLUSH'
)
AND waiting_tasks_count > 0
ORDER BY wait_time_ms DESC;
Prevention
No prevention is needed for LOGMGR_QUEUE as this represents normal, healthy SQL Server operation. The log writer must wait for work when no transactions are generating log activity, making this wait unavoidable and desirable.
Modern monitoring tools like AutoDBA automatically filter benign waits from alerting and reporting, allowing DBAs to focus on performance issues that require action rather than investigating normal background processes.
Need hands-on help?
Dealing with persistent logmgr_queue issues across your environment? Samix Technology provides hands-on SQL Server performance consulting with 15+ years of production DBA experience.