SQL Server 2019 Log Writer Workers

 

·       Version : SQL Server 2014, SQL Server 2016, SQL Server 2017, SQL Server 2019

 

SQL Server 2017 숨겨진 스케줄러에서 최대 4개의 Log Writer Worker 활용하여 트랜잭션 로그 처리 활동을 지원한다.

 

SQL Server 2019 버전부터는 하드웨어 성능에 따라 최대 Log Writer Worker 수가  최대 8개까지 증가한다.

;with kgroups AS

(SELECT kgroup_count = COUNT(DISTINCT processor_group)

 FROM sys.dm_os_nodes osn)

SELECT SQLServer_version = SERVERPROPERTY('ProductVersion'), sinfo.scheduler_count,

       sinfo.cpu_count, sinfo.softnuma_configuration_desc, sinfo.socket_count,

    sinfo.numa_node_count, kgroups.kgroup_count

FROM sys.dm_os_sys_info sinfo

CROSS JOIN kgroups;

 

SELECT req.session_id, req.command, sch.scheduler_id, sched_status = sch.[status],

       sch.cpu_id, sch.parent_node_id, osn.memory_node_id, osn.processor_group

FROM sys.dm_exec_requests req

JOIN sys.dm_os_schedulers sch ON req.scheduler_id = sch.scheduler_id

JOIN sys.dm_os_nodes osn ON sch.parent_node_id = osn.node_id

WHERE req.command = 'LOG WRITER';

 

 

 SQL Server 서비스 시작시 시스템 리소스 상태에 따라 Log Writer Worker수를 결정하며  아래 그림은 SQL Server 2019 2Core CP, 2GM RAM에서 실행 하였을때, Log Writer Worker 수를 SQL Server Error Log에서 확인한 것이다.

 

 

여러 Log Writer Worker 허용되지 않는 경우 단일 Log Writer Worker  사용한다그렇지 않으면 아래 공식을 사용하여 Log Writer Worker 수를 계산한다.

·        NUMA 노드 X 2

·       NUMA 노드에서 사용사능한 CPU  계산 (affinity mask 설정에 따라 CPU 카운트에 영향을   있음)

 

MAX_LOG_WRITERS 허용에 따라 또는 8개가 할당 된다.

 

[참고자료]

·       https://blogs.msdn.microsoft.com/bobsql/2019/02/11/sql-server-log-writer-workers/

·       http://sql-sasquatch.blogspot.com/2019/06/sql-server-2019-ctp-30-max-number-of.html

 

 

 

2019-09-19/ Sungwook Kang / http://sungwookkang.com

 

 

SQL Server2017, SQL Server 2019, Log Writer Worker, 로그 쓰기 워커, NUMA, OS NODE



출처: https://sqlmvp.tistory.com/1344 [Database Lab]




profile

강성욱 / jevida@naver.com
Microsoft SQL Server MVP
Blog : http://sqlmvp.kr
Facebook : http://facebook.com/sqlmvp

Kakao Talk : SQLMVP

Line : jevida


현재 LA에 거주하고 있으며 SQL에 관심있는 분이면 언제든 친추 환영합니다.