星空网 > 软件开发 > 数据库

VMware中CPU分配不合理以及License限制引起的SQL Scheduler不能用于查询处理

有一台SQL ServerSQL Server 2014 标准版)服务器中的scheduler_count与cpu_count不一致,如下截图所示:

SELECT  cpu_count ,
        scheduler_count 
FROM    sys.dm_os_sys_info;


VMware中CPU分配不合理以及License限制引起的SQL Scheduler不能用于查询处理

 

SQL Server中Scheduler数量应该与逻辑CPU的核数一致,而sys.dm_os_sys_info中的scheduler_count 为8,少于cpu_count的12个数量,那么很有可能,有一些Scheduler的状态为VISIBLE ONLINE.下面摘自Healthy SQL: A Comprehensive Guide to Healthy SQL Server Performance

VMware中CPU分配不合理以及License限制引起的SQL Scheduler不能用于查询处理

SELECT  is_online 
       ,[status]
       , COUNT(*) AS [count]
FROM sys.dm_os_schedulers
WHERE scheduler_id < 255
GROUP BY is_online,
         [status];


VMware中CPU分配不合理以及License限制引起的SQL Scheduler不能用于查询处理

 

官方文档https://msdn.microsoft.com/en-us/library/ms177526.aspx关于Status的介绍如下:

Indicates the status of the scheduler. Can be one of the following values:

- HIDDEN ONLINE

- HIDDEN OFFLINE

- VISIBLE ONLINE

- VISIBLE OFFLINE

- VISIBLE ONLINE (DAC)

- HOT_ADDED

Is not nullable.

HIDDEN schedulers are used to process requests that are internal to the Database Engine. VISIBLE schedulers are used to process user requests.

OFFLINE schedulers map to processors that are offline in the affinity mask and are, therefore, not being used to process any requests. ONLINE schedulers map to processors that are online in the affinity mask and are available to process threads.

DAC indicates the scheduler is running under a dedicated administrator connection.

HOT ADDED indicates the schedulers were added in response to a hot add CPU event.

 

其中关于OFFLINE与ONLINE的解释:OFFLINE 计划程序在关联掩码中映射到处于脱机状态的处理器,因此不用于处理任何请求。 ONLINE 计划程序在关联掩码中映射到处于联机状态的处理器,并且可用于处理线程

 

基本上,调度程序(SQL Schedulers)不会用于查询处理。 这种情况是由关联掩蔽或许可限制引起的:

 

SQL Schedulers disabled

When SQL Server uses a portion of the server processors , the is_online column on the sys.dm_os_schedulers will return 0.

 Basically , the scheduler will not be used for query processing. The situation is caused by either affinity masking or licensing restrictions

Be careful if you attempt to change these number – either be confident you know how to use affinity masking or if Virtualization is used , speak to the VM administrator about apportioning more cores per virtual socket. In either case analyse the impact and test thoroughly

 

检查服务器的CPU资源使用情况,发现在Resource Monitor里面,有些逻辑CPU上利用率几乎为零。基本上就可以判定是SQL License许可限制的可能性最大

 

VMware中CPU分配不合理以及License限制引起的SQL Scheduler不能用于查询处理

VMware中CPU分配不合理以及License限制引起的SQL Scheduler不能用于查询处理

 

检查官方文档SQL Server 2014 各个版本支持的功能发现标准版单个实例使用的最大计算能力(SQL Server 数据库引擎)限制为4个插槽或16核,取两者中最小值。如下截图所示

 

VMware中CPU分配不合理以及License限制引起的SQL Scheduler不能用于查询处理

 

检查服务器的CPU配置,发现CPU资源配置如下:12核是(虚拟插槽数6*每个插槽的内核数为2)也就是说6*2=12 ,超出了License限制(4个插槽数),所以应该调整为4(虚拟插槽数)*3(内核数)才能有效的利用分配到CPU资源.

VMware中CPU分配不合理以及License限制引起的SQL Scheduler不能用于查询处理

 

参考资料:

https://msdn.microsoft.com/zh-cn/library/ms177526.aspx

http://www.sqlserver-dba.com/cpu/




原标题:VMware中CPU分配不合理以及License限制引起的SQL Scheduler不能用于查询处理

关键词:sql

sql
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

跨境电商蓝牙产品清关要求,你知道多少?:https://www.ikjzd.com/articles/15705
法国EPR危机警告!2022年10月这个类目必须进行申报:https://www.ikjzd.com/articles/1570593621527994370
独立站官网如何优化产品列表页?这样做,转化率暴增!:https://www.ikjzd.com/articles/1570595285684740097
电商支出猛增72%?外贸公司如何利用自建站开拓加拿大市场?:https://www.ikjzd.com/articles/1570596702168309761
四大品类旺季营销划重点,大促流量密码抢先Get!:https://www.ikjzd.com/articles/1570597000303632386
英国市场又有新变化,跨境卖家如何握紧出海“通行证”:https://www.ikjzd.com/articles/1570597443138723841
秦皇岛到丹东旅游景点大全 秦皇岛到丹东开车多长时间:https://www.vstour.cn/a/408253.html
求推荐适合情侣玩的地方,三天时间,谢谢:https://www.vstour.cn/a/408254.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流