http://www.cnblogs.com/diabloxl/p/3623640.html?utm_source=tuicool&utm_medium=referral

公司这边性能组老师进行性能测试 发现智能用到20个core

同事排查到了问题原因, 正好博客园里面有一个blog 详细描写了 这个区别.

转帖一下, 感谢原作者. 后续再仔细看看这一块.

问题描述:生产环境一个数据库从SQLSERVER 2008 R2升级到SQLSERVER 2012 ,同时更换硬件,但迁移后发现性能明显下降,应用写入、读取性能下降的比较厉害;

向微软寻求帮助后得出答案,原来这与SQLSERVER的安装介质有关。

大致意思是说由于NUMA架构可以自行管理内存池,在安装了CAL的EE后,由于限制只能使用20个cores,同样内存则只能管理到20个cores涉及到的NUMA的对应的内存空间(具体算法为 限制内存=当前物理内存/NUMA数量*(总核数/20)),如果限制SQL Server的最大使用内存超过前面说的限制内存,则当使用内存大于限制内存需要再向操作系统再申请空间时,则会产生跨NUMA处理的情况,导致大量消耗系统资源,引起性能下降;

http://blogs.msdn.com/b/saponsqlserver/archive/2012/06/15/sql-server-2012-enterprise-editions.aspx

这是我在网上找到的解释,摘录其中几段(本人E文水平有限,翻译不当之处敬请见谅)

关于SQLSERVER EE的安装介质(EE为Enterprise Editions简拼,企业版)

  • SQL Server EE is no longer being offered under the Server + CAL (Client Access License) licensing model. For customers with Software Assurance on existing SQL EE Server licenses (or access to them under their current Enterprise Agreements during term) a version of Enterprise Edition was created to enable them to upgrade to SQL Server 2012. This version has technical restrictions limiting an instance to using only 20 processor cores (40 CPU threads with Hyperthreading).. Customers must still have the proper version of the CAL and additional physical and virtual use right restrictions of this SKU (Stock Keeping Unit) apply. Please refer to the three documents listed above for additional details.
  • An Enterprise Edition which is licensed per core and which does not have limits on the # of cores usable on a server (within the absolute limits supported). This Enterprise Edition does reflect the new licensing model for SQL Server Enterprise Edition.

上面说到 即便是SQLSERVER EE,由于授权方式的差异导致对processor cores的限制

For customers with Software Assurance on existing SQL EE Server licenses

An Enterprise Edition which is licensed per core and which does not have limits on the # of cores usable on a server

通过以下方式可以检查当前运行的SQL EE信息

1、sp_readerrorlog ,第一行显示SQLSERVER 版本信息如下

2012-05-08 16:04:54.56 Server      Microsoft SQL Server 2012 - 11.0.2100.60 (X64)

Feb 10 2012 19:39:15

Copyright (c) Microsoft Corporation

Enterprise Edition (64-bit)on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)

2、select serverproperty('Edition') ,显示版本信息如下

Enterprise Edition (64-bit)

如何判断当前的SQL EE是基于per CAL还是per core的呢?如果显示的信息如上所示,那就是基于per CAL的,文中再次强调此模式下受限于20 cores;

Answer is: It is the CAL licensed one and with that the Enterprise Edition which is limited to 20 cores!!!

而如果显示的信息如下所示,那就是基于per core的 则没有限制;

The per-core licensed Enterprise Edition will show like this:

2012-05-18 23:57:29.77 Server Microsoft SQL Server 2012 - 11.0.2100.60 (X64)

Feb 10 2012 19:39:15

Copyright (c) Microsoft Corporation

Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)

Executing:

select serverproperty('Edition')

which then could show this result:

Enterprise Edition: Core-based Licensing (64-bit)

关于20 cores的限制问题,需要区分CPU是否支持超线程而言

Other indications that there might be a limitation to 20 cores could be identified as well at the beginning of the SQL Server 2012 errorlog where we can find a message like:

SQL Server detected 4 sockets with 6 cores per socket and 6 logical processors per socket, 24 total logical processors; using 20 logical processors based on SQL Server licensing.

In the case above, we are looking at a server with the last generation of Intel processors which did not have Hyperthreading yet. Or in more modern Intel Servers with Hyperthreading it would look like:

SQL Server detected 4 sockets with 8 cores per socket and 16 logical processors per socket, 64 total logical processors; using 40 logical processors based on SQL Server licensing.

上文中的描述,根据SQL Server 2012 errorlog中的内容,我们可以看到

如果SQL Server 检测到 4个插槽,每个插槽有6个核,且有6个逻辑处理器(单线程),则总共为24个逻辑处理器,受限于SQL Server licenseing,只能使用20个逻辑处理器;

对于超线程CPU:

如果SQL Server 检测到 4个插槽,每个插槽有8个核,且有16个逻辑处理器(单线程),则总共为64个逻辑处理器,受限于SQL Server licenseing,只能使用40个逻辑处理器;

Another possibility of discovery is through the Microsoft MAP toolkit. Where to get it and how to use it is excellently described in this document: http://download.microsoft.com/download/F/F/2/FF29F6CC-9C5E-4E6D-85C6-F8078B014E9F/Determining_SQL_Server_2012_Core_Licensing_Requirements_at_SA_Renewal_Apr2012.pdf

另外一种可能的发现是通过Microsoft MAP toolkit,可以在以下这个文档中得到更准确的描述;

---------------------------华丽丽的分割线---------------------------------------

How is the throttle of 20 cores enforced for the CAL license-based Enterprise Edition?

The limitation or the cap is enforced by the # of SQL Server schedulers. Usually SQL Server creates one scheduler thread for every logical CPU on a server. Each of those scheduler threads is administrating a pool of worker threads which execute requests or are in different other states. A scheduler only can have one thread running at maximum. If a scheduler thread over all of the time has one of worker threads running, it can leverage at maximum one logical CPU and not a bit more. If there are (as in the second situation above) only 40 schedulers active to schedule worker threads, the maximum number of CPU power we can use at any given time is 40 logical CPUs.

Querying sys.dm_os_schedulers with this query:

select * from sys.dm_os_schedulers

we will realize that the all the schedulers are ‘Visible’ for all the logical CPUs, but only 40 of them will be ‘Online’, whereas the others are ‘Offline’

If you disable Hyperthreading, the number of schedulers being Online will decline to 20, since one single core is now represented by one CPU thread only compared to two with Hyperthreading enabled. In cases where there are many more CPU threads or logical CPUs than the limit of the Server+CAL licensed SQL Server 2012 Enterprise Edition, one certainly can use affinity mask settings to chose the CPUs SQL Server shall use.

通过sys.dm_os_schedulers这个DMV可以查询到SQL Server调度线程的情况;

如何在EE的两个不同的产品间变更?在下面的链接中可以找到答案

http://msdn.microsoft.com/zh-cn/library/ms143393.aspx

[转帖] sqlserver CAL 授权模式下 只能够有20个core的使用问题的更多相关文章

  1. 浅析SqlServer简单参数化模式下对sql语句自动参数化处理以及执行计划重用

    我们知道,SqlServer执行sql语句的时候,有一步是对sql进行编译以生成执行计划, 在生成执行计划之前会去缓存中查找执行计划 如果执行计划缓存中有对应的执行计划缓存,那么SqlServer就会 ...

  2. 弹出层在兼容模式和IE8模式下显示不正常

    弹出层在火狐.谷歌.360极速模式.IE6下都能100%面积正常显示,但在IE8和360的兼容模式下只显示弹出层下半部分或右半部分的内容,在主页面加上: <meta http-equiv=&qu ...

  3. Spring Security OAuth2 微服务认证中心自定义授权模式扩展以及常见登录认证场景下的应用实战

    一. 前言 [APP 移动端]Spring Security OAuth2 手机短信验证码模式 [微信小程序]Spring Security OAuth2 微信授权模式 [管理系统]Spring Se ...

  4. spring-oauth-server实践:授权方式四:client_credentials 模式下有效期内重复申请 access_token ?

    spring-oauth-server入门(1-12)授权方式四:client_credentials 模式下有效期内重复申请 access_token ? 一.失效重建邏輯 二.如果沒有失效,不会重 ...

  5. spring-oauth-server实践:使用授权方式四:client_credentials 模式下access_token做业务!!!

    spring-oauth-server入门(1-10)使用授权方式四:client_credentials 模式下access_token做业务!!! 准备工作 授权方式四::客户端方式: 服务网关地 ...

  6. 无法序列化会话状态。在“StateServer”或“SQLServer”模式下,ASP.NET 将序列化会话状态对象,因此不允许使用无法序列化的对象或 MarshalByRef 对象。如果自定义会话状态存储在“Custom”模式下执行了类似的序列化,则适用同样的限制。

    将项目部署到服务器后发现有如下问题,查了网上好多说是需要被序列化的类没有写上[Serializable]标志,所以把全部需要序列化的列都写上了标志发现还是不是,最后查到了发现网上说的并不太准确,而是需 ...

  7. 关于:“无法序列化会话状态。在“StateServer”或“SQLServer”模式下,...的问题

    关于:“无法序列化会话状态.在“StateServer”或“SQLServer”模式下,...的问题 错误描述: 无法序列化会话状态.在“StateServer”或“SQLServer”模式下,ASP ...

  8. c语言: 错误:只允许在 C99 模式下使用‘for’循环初始化声明 用gcc编译出现

    在gcc编译中如果使用 for(int i=0;i<n;++i){}会提示错误 错误:只允许在 C99 模式下使用'for'循环初始化声明 用gcc编译出现 就是说你的你的c编译器不是c99标准 ...

  9. 【.NET Core项目实战-统一认证平台】第十一章 授权篇-密码授权模式

    [.NET Core项目实战-统一认证平台]开篇及目录索引 上篇文章介绍了基于Ids4客户端授权的原理及如何实现自定义的客户端授权,并配合网关实现了统一的授权异常返回值和权限配置等相关功能,本篇将介绍 ...

随机推荐

  1. Spring Boot:项目打包成war并发布到Tomcat上运行

    一.修改pom文件 1. 因为SpringBoot中嵌入的有Tomcat,因此要移除嵌入式的Tomcat插件 <dependency> <groupId>org.springf ...

  2. iOS开发-通过正则表达式进行各种判断银行卡,车牌号,邮箱地址,QQ,身份证,全字母,仅输入字母或数字同时包含大小写字母和数字,仅能输入中文等

    /* *  验证银行卡号是否正确 *  车牌号验证 *  检验邮箱地址是否正确 *  手机号中间四位密文显示 *  判断QQ号是否正确(5-11位) *  判断身份证号是否正确(如末位为字母请用“x” ...

  3. bootstrap图标显示为方框的解决方案

    这是因为没有 fonts 库导致的,只需要放入项目目录即可正常显示图标

  4. JDBC连接数据库及其执行操作

    作者:Alvin 功能:数据库连接与实现增删改查 时间:2019年3月4日08点33分 参考文章:https://www.2cto.com/database/201805/743741.html 一. ...

  5. Git命令简单总结

    集中式vs分布式 svn集中式:版本库是集中存放在中央服务器的,需要联网才能工作 git 分布式:每个人的电脑上都是一个完整的版本库 和集中式版本控制系统相比,分布式版本控制系统的安全性要高很多,因为 ...

  6. JavaScript中的null和undefined

    null :表示无值;undefined : 表示一个未声明的变量,                或已声明但没有赋值的变量,                或一个并不存在的对象属性. ==运算符将两 ...

  7. BLACKPYTHON学习(一)

    C/S结构了解 所谓的C/S就是客户端(client)和服务器端(server)的简称,也就是在基于这个的基础上编写相关的代码:一个就是客户端一个就是服务端. TCP(client) 客户端编写 #因 ...

  8. 服务治理-> Spring Cloud Eureka

    服务治理->搭建服务注册中心 服务治理可以说是微服务架构中最为核心和基础的模块, 它主要用来实现各个微服务 实例的自动化注册与发现. 为什么我们在微服务架构中那么需要服务治理模块呢?微服务 系统 ...

  9. python的字符串格式化

    1.python到底有那几种字符串格式化模块? python有3种格式化字符串的方法: 传统的%字符串格式符 str.format函数 字符串模版template 新的python 3.6+还提供了新 ...

  10. HIVE函数的UDF、UDAF、UDTF

    一.词义解析 UDF(User-Defined-Function) 一进一出 UDAF(User- Defined Aggregation Funcation) 多进一出 (聚合函数,MR) UDTF ...