SQL 2016 - It Just Runs Faster: Multiple Log Writer Workers
Published Jan 15 2019 04:58 PM 1,094 Views
Microsoft

First published on MSDN on Apr 19, 2016

 

SQL Server 2016 introduces multiple log writer workers to the engine.    For many years the log device was limited by the capabilities of spinning media and hardware caches.    The advancement of hardware caches and fast storage types (SSD, flash, …) on large installations can saturate a single log write worker.

 

SQL Server 2016 extended the log writer by allowing up to 4 workers for the instance. You can find out the number of log writers present in your SQL Server using the following command:

 

select session_id, status, command, scheduler_id, task_address, wait_type

from sys.dm_exec_requests

where command = 'LOG WRITER'

 

The number of log writers created during the SQL Server instance startup depends on the number of hardware NUMA nodes present on the system. If there is only one NUMA node, then there will be only one log writer created. For systems with multiple NUMA nodes, there can be a maximum of 4 log writer threads.

 

If you have configured the affinity I/O mask (not recommended) the log writer threads are bound to the CPU mask specified in the affinity I/O mask configuration. Otherwise, the log writer threads will be created on separate hidden schedulers. These hidden schedulers are always bound to NUMA node 0. These decision to cap the maximum number of log writers and their placement is based on extensive performance tests conducted with heavy concurrent activities of multiple log writers accessing the log flush queue.

 

Until SQL17, Log Writers are always bound to node 0 CPUs regardless of the affinity setting. Because of this behavior, it is not a best practice to disable node 0. If you need to disable node 0 for some reason, another node needs to be disabled.

 

'It Just Runs Faster' - SQL Server 2016 uses up to 4, log writer workers to service log write activities improving LDF throughput capabilities.

 

Suresh Kandoth -Senior SQL Server Escalation Engineer

Nitin Verma - Senior Software Engineer

Co-Authors
Version history
Last update:
‎Mar 03 2021 12:51 PM
Updated by: