LOGMGR_FLUSH Wait Type in SQL Server

⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: WRITELOG Wait TypeRelated pillar: Backup & Recovery

Is It a Problem?

Rarely on its own. It is not reported as a contention point; on our SQL Server 2025 lab it had about 1,800 waits averaging under a millisecond. Get Wait Statistics does not filter it out, so if it ranks, you will see it. It is worth reading only alongside WRITELOG: if both rise, both point at the transaction log not being written fast enough.


What It Means

Microsoft lists it as identified for informational purposes only, not supported. The wait was repurposed from SQL Server 2016 and is now a thread that is generating a log record and has to wait for the current log flush to complete. It probably ties in with the extra background log writer threads added in SQL Server 2016, though that link is an expectation rather than a documented fact.


When It Does Matter

Only as a second witness to log write pressure. Check log file write latency:

SELECT
    DB_NAME(vfs.database_id) AS database_name,
    mf.type_desc,
    mf.physical_name,
    vfs.num_of_reads,
    CAST(vfs.io_stall_read_ms * 1.0 / NULLIF(vfs.num_of_reads, 0) AS DECIMAL(12, 2)) AS avg_read_ms,
    vfs.num_of_writes,
    CAST(vfs.io_stall_write_ms * 1.0 / NULLIF(vfs.num_of_writes, 0) AS DECIMAL(12, 2)) AS avg_write_ms
FROM sys.dm_io_virtual_file_stats(NULL, NULL) AS vfs
JOIN sys.master_files AS mf
    ON mf.database_id = vfs.database_id AND mf.file_id = vfs.file_id
WHERE mf.type_desc = N'LOG'
ORDER BY vfs.io_stall_read_ms + vfs.io_stall_write_ms DESC;

The baseline to monitor is each log file’s avg_write_ms against its own history; the counters are cumulative since restart, so compare two readings. If WRITELOG is quiet, LOGMGR_FLUSH on its own is not worth your time. The query needs VIEW SERVER STATE.


The LOG Family

These are the transaction log waits: sessions waiting for log to be written, for room in the log buffer or the log file, and the log writer itself idling. The one that usually costs users time is the main page, WRITELOG.

  • WRITELOGLog flush. A session waiting for its log records to be written to disk.The main page for this family
  • LOGBUFFERLog buffer. Waiting for space in the log buffer to store a log record.Worth a look when it climbs
  • LOGMGR_RESERVE_APPENDLog space. Waiting to see whether truncation frees space in a full log.Worth a look when it climbs
  • LOGMGR_FLUSHFlush in progress. Documented for information only; reported as waiting for the current log flush.Usually noise. This page.
  • LOGMGR_QUEUELog writer idle. The log writer waiting for work requests.Usually noise
  • LOGMGRClosing the log. Waiting for outstanding log I/O before the log shuts down as a database closes.Usually noise
  • LOGPOOL waitsLog pool. The in-memory cache of recently flushed log blocks.Usually noise

Where To Go Next

LOGMGR_FLUSH is usually small. 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 *