Alloctaion bottleneck refers to contention in the system pages that store allocation structures.

PFS(Page Free Space): used to track the followint information about each page:

1. free space available

2. if it is allocated or not

3. has ghost records(when a row is deleted, it is marked as ghost)

PFS use 1byte/page and each PFS page stores stats for 8088 pages

GAM(Global allocation Map): used  to trackis a uniform extent is free or not, use one bit to ideitify one extent, so each GAM page stores status for  64000 extents or 4 GB

SGAM(Share Allocation Map): tracks if an extent is mixed extent or not, one bit '1' indicates that it is a mixed extent and has one or more free pages, each SGAM page cover 64000 extent or 4GB

if one objects use more then 7 pages, SQL SERVER will allocate uniform extents for it.

Each database file have thire owm PFS/GAM/SGAM pages.

When one object was created(destoryed) or page was allocated(deallocated), SQL Server need search the allcation page with SH latch and update the allocation page with X latch, multiple thread need to wait to acquire X or SH latch in non coflicting mode which can lead to allocation bootleneck.

starting with sql server 2005, the cahcing mechanism for objects in TempDB Has been improved siginificantly which reduce the alloctaion contention incurred by your workload.

检查是否有分配页阻塞

--=============================================
--检查Tempdb上的页面争抢
--http://www.sqlsoldier.com/wp/sqlserver/breakingdowntempdbcontentionpart2
With Tasks
As (Select session_id,
wait_type,
wait_duration_ms,
blocking_session_id,
resource_description,
PageID = Cast(Right(resource_description, Len(resource_description)
- Charindex(':', resource_description, 3)) As Int)
From sys.dm_os_waiting_tasks
Where wait_type Like 'PAGE%LATCH_%'
And resource_description Like '2:%')
Select session_id,
wait_type,
wait_duration_ms,
blocking_session_id,
resource_description,
ResourceType = Case
When PageID = 1 Or PageID % 8088 = 0 Then 'Is PFS Page'
When PageID = 2 Or PageID % 511232 = 0 Then 'Is GAM Page'
When PageID = 3 Or (PageID - 1) % 511232 = 0 Then 'Is SGAM Page'
Else 'Is Not PFS, GAM, or SGAM page'
End
From Tasks;

Tempdb--Allocation Bottleneck的更多相关文章

  1. Tempdb--monitoring and troubleshooting

    TempDB用来存放临时表.全局临时表.表变量以及排序或HASH等操作引发的中间结果集 TempDB在每次实例重启时重新创建,TempDB数据库文件的初始化大小取决于Model数据库的文件大小或显示A ...

  2. Tempdb--TempDB Basic

    1. TempDB只能运行在Simple Recovery Model下 2. 由于TempDB不需要Recovery,因此在TempDB中发生的操作不需要REDO,因此在日志记录上有别于其他数据库. ...

  3. SQL Server 2008性能故障排查(四)——TempDB

    原文:SQL Server 2008性能故障排查(四)--TempDB 接着上一章:I/O TempDB: TempDB是一个全局数据库,存储内部和用户对象还有零食表.对象.在SQLServer操作过 ...

  4. Expert 诊断优化系列------------------给TempDB 降温

    前面文章针对CPU.内存.磁盘.语句.等待讲述了SQL SERVER的一些基本的问题诊断与调优方式.为了方便阅读给出导读文章链接方便阅读: SQL SERVER全面优化-------Expert fo ...

  5. Attempt to fetch logical page (...) in database 2 failed. It belongs to allocation unit xxxx not to xxx

    今天一个同事说在一个生产库执行某个存储过程,遇到了错误: Fatal error 605 occurred at jul 29 2014 我试着执行该存储过程,结果出现下面错误,每次执行该存储过程,得 ...

  6. SQLSERVER中的ALLOCATION SCAN和RANGE SCAN

    SQLSERVER中的ALLOCATION SCAN和RANGE SCAN 写这篇文章的开始,我还不知道ALLOCATION SCAN的工作原理是怎样的,网上资料少得可怜 求助了园子里的某位大侠,他看 ...

  7. 第23/24周 临时数据库(TempDb)

    在今天的性能调优培训里我们讨论下TempDb——SQL Server的公共厕所,在SQL Server里我是这样描述它的.我们的每个人都会经常使用TempDb.有些人直接使用它,有些人不直接使用它.今 ...

  8. SQL Server 2016里TempDb的提升

    几个星期前,SQL Server 2016的最新CTP版本已经发布了:CTP 2.4(目前已经是CTP 3.0).这个预览版相比以前的CTP包含了很多不同的提升.在这篇文章里我会谈下对于SQL Ser ...

  9. Tempdb的并发阻塞

    9.3 Tempdb的并发阻塞 在介绍Tempdb的并发问题前,先介绍几个比较特殊的数据页. PFS(Page Free Space),用于标识数据页空间的使用情况,以字节标识,可以表示数据页使用百分 ...

随机推荐

  1. 第九章 自定义mixer adapter

    1 install/kubernetes/helm/istio/templates/crds.yaml 序号 名称 用途 分类 归属 virtualservices.networking.istio. ...

  2. Python实现进度条总结

    先说一下文本系统的控制符:\r:   将光标移动到当前行的首位而不换行:\n:   将光标移动到下一行,并不移动到首位:\r\n: 将光标移动到下一行首位.     环境:root@ubuntu16: ...

  3. MongoDB 生态 – 可视化管理工具

    工欲善其事,必先利其器,我们在使用数据库时,通常需要各种工具的支持来提高效率:很多新用户在刚接触 MongoDB 时,遇到的问题是『不知道有哪些现成的工具可以使用』,本系列文章将主要介绍 MongoD ...

  4. c++builder 字节 编码 转换大全 String TBytes byte

    System.SysUtils System::DynamicArray<System::WideChar> TCharArray System::TArray__1<System: ...

  5. 用WINSOCK API实现同步非阻塞方式的网络通讯

    Option Base 0Option Explicit '* ************************************************** *'*  模块名称:Winsock ...

  6. Cardboard Talk01 HeadTracker

    操作系统:Windows8.1 显卡:Nivida GTX965M 开发工具:Android studio 3.0.0 | Cardboard 1.0 使用 Google 的 Cardboard开发V ...

  7. 【Git】三、工作区、暂存区、版本库

    一.基础概念 工作区:电脑中可以看到的目录,为电脑中的项目文件 暂存区:暂存修改的地方 版本库:存放项目的各个版本文件 二.详细介绍 工作区为我们工作所使用的目录,在工作区我们对项目文件进行增删改查. ...

  8. win7 python2.7安装PIL库

    一.前言 遇到客户给了一个需求,需要拼接多个图片,上网找到一个解决方式,不过是需要安装PIL的,相信安装过这个库的应该都遇到很多问题,接下来说说怎么解决. 我的环境是: 操作系统:win10 64bi ...

  9. MYISM表并发写请求过多 导致无法被读取解决方案

    MyISAM锁调度是如何实现的呢,这也是一个很关键的问题.例如,当一个进程请求某个MyISAM表的读锁,同时另一个进程也请求同一表的写锁,此时MySQL将会如优先处理进程呢?通过研究表明,写进程将先获 ...

  10. MySQL数据库远程连接的配置方案

    首先,目的是使用本机可视化工具SQLyog通过IP地址远程访问另一台机器上的MySQL数据库. 本人实践的MySQL版本是MySQL 5.7.23,数据库部署的主机系统是Windows.这些简单配置均 ...