禁用轻型池Disable Lightweight Pooling

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions)

此规则检查服务器上是否已禁用轻型池。This rule checks that lightweight pooling is disabled on the server. 将 lightweightpooling 设置为 1 将使 SQL ServerSQL Server 切换到纤程模式计划。Setting lightweightpooling to 1 causes SQL ServerSQL Server to switch to fiber mode scheduling. 纤程模式专用于 UMS 工作线程的上下文切换是性能的主要瓶颈的某些情况。Fiber mode is intended for certain situations in which the context switching of the UMS workers is the important bottleneck in performance. 由于这种情况很少出现,所以纤程模式很少提高典型系统上的性能或可伸缩性。Because this is rare, fiber mode seldom improves performance or scalability on the typical system.

最佳做法建议Best Practices Recommendations

lightweightpooling 选项应仅在以下情况下启用:进行彻底的测试之后、评估所有其他性能优化机会之后,以及上下文切换在您的环境中是已知问题时。The lightweightpooling option should only be enabled after thorough testing, after all other performance tuning opportunities are evaluated, and when context switching is a known issue in your environment.

建议您不要使用纤程模式计划日常操作,这是因为它会抑制上下文切换优势的正常发挥,并且使用线程本地存储区 (TLS) 或线程所有的对象(如互斥体,一种 Win32 内核对象)的某些 SQL ServerSQL Server 组件在纤程模式下无法正常工作We recommend that you do not use fiber mode scheduling for routine operation because it can decrease performance by preventing the regular benefits of context switching, and because some components of SQL ServerSQL Server that use Thread Local Storage (TLS) or thread-owned objects, such as mutexes (a kind of Win32 kernel object), cannot function correctly in fiber mode

若要删除轻型池,请执行下面的语句,然后重新启动 SQL Server 数据库引擎SQL Server Database EngineTo remove lightweight pooling, execute the following statement, and then restart the SQL Server 数据库引擎SQL Server Database Engine.

sp_configure 'show advanced options', 1;  
GO  
sp_configure 'lightweight pooling', 0;  
GO  
RECONFIGURE;  
GO  

有关详细信息For More Information

lightweight pooling 服务器配置选项lightweight pooling Server Configuration Option

另请参阅See Also

使用基于策略的管理来监视和强制执行最佳做法Monitor and Enforce Best Practices by Using Policy-Based Management