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

原文: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

时间: 2024-08-31 19:15:21

SQLServer 2012异常问题(二)--由安装介质引发性能问题的相关文章

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

原文:SQLServer 2012异常问题(一)--故障转移群集+镜像环境导致作业执行失败 先感谢一下我的同事们最先发现此问题,鸣谢:向飞.志刚.海云 最近在生产环境发现一个诡异的问题: 环境:WINDOWS 2012+SQLSERVER 2012 SP1,双节点的故障转移群集+单节点的SQLSERVER 2012 SP1实例(镜像) 生产数据库是从SQLSERVER 2008R2迁移到2012的,迁移过程很顺利,按照一般经验,可能导致数据库所有者丢失,因此在迁移后手动修改数据库所有者为sa,与

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

原文:SQLSERVER 2012之AlwaysOn -- 一次硬件升级引发的问题 这是上周遇到的一个案例:对已有的硬件进行升级而引发的问题,期间还触发了一个比较严重的BUG,可谓多灾多难:不过值得庆幸的是,在一连串连锁问题出现的时候,并没有出现人工操作失误(这往往是在处理故障中风险最高.影响最大的问题)而扩大故障影响范围:   ==========================华丽丽的分割线==========================     先说一下环境:     我做的是跨机房3

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

原文:SQLSERVER 2012之AlwaysOn -- 同步模式下的网卡性能优化 本文是基于上一篇<SQLServer 2012之AlwaysOn -- 指定数据同步链路,消除网络抖动导致的提交延迟问题>的问题继续进行优化:具体背景请参照上文:     前后折腾了一个多月,最近终于把这块难啃的骨头搞定了.问题只是出在网卡的高级功能上:     解决方案:关闭网卡的高级功能Jumbo Mtu和Large Send Offload V2     问题分析:根据Broadcom Ethernet

SQLServer 2012 登陆异常问题

背景 RDS FOR SQLServer 2012 已经上线一段时间了,从反馈来看大家遇到了很多权限相关的问题,所以建议把RDS FOR SQLServer 2012权限提升这篇文章作为基础知识先能够理解:再之后针对大家经常遇到的CASE我们会把解决方法分享出来,本篇文章是其中之一. 问题 用户应用链接数据库失败 持续报错,业务因此停滞,使用SSMS链接也出错 Detail =================================== Cannot connect to * =====

Windows 2008 R2实战之二:从介质安装 AD DS

从介质安装 AD DS可以使用 Ntdsutil.exe 为在域中创建的其他域控制器创建安装介质.通过从介质安装,可以最大程度地减少网络上目录数据的复制.有利于在远程站点中更高效地安装其他域控制器. 实验环境: 在Windows 2008 R2实战之一:活动目录部署的实验环境下,新增了一台http://www.aliyun.com/zixun/aggregation/13975.html">Windows Server 2008 R2服务器,计算机名Win2008R2CNDC01. 实验要

SqlServer 2012数据库邮件问题

问题描述 SqlServer 2012数据库邮件问题 配置数据库邮件,发送测试邮件时提示: 消息 由于邮件服务器故障,无法将邮件发送给收件人. (使用帐户 1 (2015-01-10T11:29:26) 发送邮件. 异常邮件: 无法将邮件发送到邮件服务器. (操作已超时.). ) 1.使用foxmail使用相同配置发送邮件正常 2. 防火墙已经关了,不存在防火墙的问题 有没有人遇到相同的问题呢? 解决方案 参考祥解使用 SQL Server 2005/2008 发送数据库邮件 除了系统自带的防火

远程连接阿里云SqlServer 2012 数据库服务器的图文教程

前言: 在使用 阿里云 上的一些产品时,遇到不少坑. 安装IIS 时,遇到因买的配置过低,虚拟内存不足,而导致 IIS 总是安装失败: 现在 在上面安装了个 Sql Sever 2012,远程老是 不能连接,百度找半天,终于能够连接上了. 实现步骤如下: 1. 找到 安全组配置,打开 安全组配置,点击配置规则,增加 地址段访问的 授权规则,Sql Server的默认端口时 1433 . 2. 服务器上 win + R  键入  compmgmt.msc ,打开 计算机管理,按照如图所示 设置.注

如何使用Sqlserver 2012 Always on技术

使用了Sqlserver 2012 Always on技术后,假如采用的配置是默认配置,会出现Primary server CPU很高的情况发生,比如默认配置如下: 需要自定义来解决这个问题. 我们先来看看上图中的这些选项的意义 主角色中的连接 允许所有连接 如果当前server是primary角色时,primary instance允许所有连接(如:读/写/管理) 允许读/写连接 如果当前server是primary角色时,primary instance只允许读/写连接(如果通过ssms连接

重装win7系统的安装介质是什么?

  1.安装介质的含义 安装介质是一种媒介,是安装程序,是用于安装程序.系统等的载体. 2.重装win7系统安装介质定义 重装win7系统的安装介质,也就是重装系统的安装介质.是重装win7系统镜像文件的载体. 3.一种安装方法对应一种安装介质,通过该介质使得win7系统的镜像文件能够释放到电脑的系统盘中,进行系统盘的还原操作,将安装程序写入系统盘中,以便后期写入系统文件. 重装系统安装介质有以下几个: 1.硬盘安装win7系统中的硬盘 2.移动硬盘安装系统中的移动硬盘 3.光盘安装win7系统