原文:SQLServer 2012异常问题(二)--由安装介质引发性能问题

问题描述:生产环境一个数据库从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 2012异常问题(二)--由安装介质引发性能问题的更多相关文章

  1. SQLServer 2012异常问题(一)--故障转移群集+镜像环境导致作业执行失败

    原文:SQLServer 2012异常问题(一)--故障转移群集+镜像环境导致作业执行失败 先感谢一下我的同事们最先发现此问题,鸣谢:向飞.志刚.海云 最近在生产环境发现一个诡异的问题: 环境:WIN ...

  2. SQLSERVER 2012之AlwaysOn -- 一次硬件升级引发的问题

    这是上周遇到的一个案例:对已有的硬件进行升级而引发的问题,期间还触发了一个比较严重的BUG,可谓多灾多难:不过值得庆幸的是,在一连串连锁问题出现的时候,并没有出现人工操作失误(这往往是在处理故障中风险 ...

  3. SQLSERVER 2012之AlwaysOn -- 同步模式下的网卡性能优化

    本文是基于上一篇<SQLServer 2012之AlwaysOn -- 指定数据同步链路,消除网络抖动导致的提交延迟问题>的问题继续进行优化:具体背景请参照上文:     前后折腾了一个多 ...

  4. windows 2008 r2或win7安装SP1补丁,安装sqlserver 2012

    说明:安装sql server 2012时,win7和win2008r2系统都需要打sp1补丁. 1.SP1补丁下载地址(建议用迅雷下载): http://download.microsoft.com ...

  5. SQLServer 2012 Always on配置全过程

    AlwaysOn取数据库镜像和故障转移集群之长.AlwaysOn不再像故障转移集群那样需要共享磁盘,从而主副本和辅助副本可以更容易的部署到不同的地理位置:AlwaysOn还打破了镜像只能1对1的限制, ...

  6. UEFI+GPT引导实践篇(一):切换到UEFI启动,准备安装介质

    如果只单纯比较UEFI引导和BIOS引导,那么毫无疑问UEFI引导要简单很多.不过现在的主板大都是同时兼容BIOS和UEFI引导方式,所以在实际操作前还需要确认一些东西.详见下文. 1.我的电脑支不支 ...

  7. Informatica学习:1、安装介质的获取与安装

    本文目标: 为方便学习Informatica工具,在个人电脑上部署Informatica Powercenter. 所用系统:win7 64位. Informatica安装包括服务器端.客户端安装两个 ...

  8. Sqlserver 2012附加数据库时出错提示操作系统错误5(拒绝访问)错误5120的解决办法

    环境: Win10系统 SQLSERver 2012 情况: 使用混合登陆方式,sa账户密码正确登陆后,附加.mdf文件出现此错误. 尝试解决方法一:使用管理员运行SQLSERver2012,sa账户 ...

  9. 微软官方安装介质Windows10系统安装教程

    微软官方安装介质Windows10系统安装教程 Jasper游戏 发布时间:04-2204:23 小贴士:事前准备 ★ 拥有 Internet 连接 ★ 在计算机.USB 或外部驱动器上拥有足够的可用 ...

随机推荐

  1. MVC模块化架构

    全面解析ASP.NET MVC模块化架构方案 什么叫架构?揭开架构神秘的面纱,无非就是:分层+模块化.任意复杂的架构,你也会发现架构师也就做了这两件事. 本文将会全面的介绍我们团队在模块化设计方面取得 ...

  2. Codeforces Round#297 div2

    B: 题意:给定一个字符串,然后给定m个数字 对于每个数字ai的含义是,将ai到n-ai+1的字符串给翻转一遍. 要求输出m次翻转之后的字符串. 想法就是判断第i个位置的字符是翻转了奇数次,还是偶数次 ...

  3. Java中动态代理技术生成的类与原始类的区别 (转)

    用动态代理的时候,对它新生成的类长什么样子感到好奇.有幸通过一些资料消除了心里的疑惑. 平时工作使用的Spring框架里面有一个AOP(面向切面)的机制,只知道它是把类重新生成了一遍,在切面上加上了后 ...

  4. hdu 2191 悼念512四川汶川大地震遇难者——如今宝,感恩生活

    悼念512四川汶川大地震遇难者--如今宝,感恩生活 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Jav ...

  5. [2014 Regional]牡丹江 H Hierarchical Notation 做题记录

    主妇:老年人谁是炮灰牡丹江,我们的团队只是做同步大赛 他决定开爆震H什么时候,A 5min 1Y.I在该限制后,纠结了很久30min+ 1Y,神继续承担各种位置卡D在,hpp见B我认为这是非常熟悉的研 ...

  6. 高级项目 它 集群环境建设(两)MySQL簇

    最后博文我们介绍一下相关概念集群,今天我们要介绍的博文MySQL相关内容集群. 1.MySQL集群简单介绍 MySQL群集技术在分布式系统中为MySQL数据提供了冗余特性,增强了安全性,使得单个MyS ...

  7. (hdu step 7.1.2)You can Solve a Geometry Problem too(乞讨n条线段,相交两者之间的段数)

    称号: You can Solve a Geometry Problem too Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/ ...

  8. Web Reference for a WCF Service has Extra “IdSpecified” Parameter ?

    Question: I created a WCF service that exposed a method that has one paramater: public class Service ...

  9. MySQL与逻辑模块

    启动MySQL 1.初始化模块运行&&存储引擎初始化运行 2.1中运行完毕后 ---->连接管理模块接手 3.连接管理模块启动处理client连接请求的监听程序(tcp/ip 网 ...

  10. poj 3662 Telephone Lines spfa算法灵活运用

    意甲冠军: 到n节点无向图,它要求从一个线1至n路径.你可以让他们在k无条,的最大值.如今要求花费的最小值. 思路: 这道题能够首先想到二分枚举路径上的最大值,我认为用spfa更简洁一些.spfa的本 ...