Process 0:0:0 (0x1ffc) Worker 0x00000001E580A1A0 appears to be non-yielding on Scheduler 3. Thread c...

本文解析了SQL Server中出现的Non-Yielding Worker问题,该问题是由于worker长时间占用scheduler导致的性能瓶颈。文章提供了从2009年至今的相关报告及分析,并给出了临时性的解决方案,包括找到并优化相关的SQL查询,调整查询调控器和并行查询阈值等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

现场报错如下:

Process 0:0:0 (0x1ffc) Worker 0x00000001E580A1A0 appears to be non-yielding on Scheduler 3. Thread creation time: 13153975602106. 
Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 21%. System Idle 76%. Interval: 73616 ms.

从报错来看是某个worker占用scheduler不释放导致,服务器具体的scheduler个数可以从sys.dm_os_sys_info.scheduler_count列中看到,一般来说服务器也就那么些核数,其中如果被non-yeilding的worker长久占用一些,将可能导致非常严重的性能问题。引发此问题的原因通常是某些查询并行度很高的SQL,也与一个BUG有关,目前从一些文档来看,此BUG并未被解决,详见:https://connect.microsoft.com/SQLServer/feedback/details/521928/worker-w-appears-to-be-non-yielding-on-scheduler-s

从2009年SQL Server2005开始,到2017年9月SQL Server 2016版本这个问题依然被报告,微软并未给出明确的解决办法。

因此目前只能在出现问题后及时找出相关的SQL优化,并且通过修改查询调控器或者并行查询阈值来避免问题出现。

从官网的解释来看:这是一个微软winsock API自己的BUG。

 

I am with the SQL Protocols Dev team. I've looked at the issue and most likely it is related to the creation of child processes from within SQL Server - e.g.
xp_cmdshell, 3rd party backup or compression software, etc. The problem occurs due to a limitation of the Winsock API which does not offer creation of
non-inheritable socket handles. If a child process of SQL Server is created after a connected socket is created and before the inheritance flag of the
socket is cleared, the child process inherits the socket handle. When closing the corresponding client connection, a proper Tcp cleanup cannot be performed
before the child process of SQL Server is closed.


To implement a temporary workaround, add the TcpAbortiveClose SQL parameter to registry as described in KB article http://support.microsoft.com/kb/307197.
Please be careful if you are doing this on a cluster to avoid checkpoint issue and registry misconfiguration which would prevent SQL from coming online.
SQL Server needs to be restarted in order the changes to take effect. No significant perf impact is expected from the change, no functional impact should be either.

 

  

转载于:https://www.cnblogs.com/leohahah/p/7778491.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值