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

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 (#换成@)。

6.2亿人口的拉美电商市场,中国跨境卖家应该怎么做?:https://www.ikjzd.com/articles/15893
2019Shopee春节物流发货安排:https://www.ikjzd.com/articles/15894
什么是Facebook广告最重要的元素?:https://www.ikjzd.com/articles/1589443762744684546
(ODI)境外投资备案是什么?:https://www.ikjzd.com/articles/1589443898682077185
重磅!TikTok美国小店定档上线!:https://www.ikjzd.com/articles/1589448725059301378
TikTok电商:这块硬骨头我必须啃:https://www.ikjzd.com/articles/1589448931477778434
6个技巧帮助你的谷歌搜索广告投放快速出单:https://www.kjdsnews.com/a/1840804.html
登顶女性类目第一,它靠生理裤营收上亿美金:https://www.kjdsnews.com/a/1840805.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流