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. Oracle Database PSU/CPU

    1. 什么是PSU/CPU?CPU: Critical Patch UpdateOracle对于其产品每个季度发行一次的安全补丁包,通常是为了修复产品中的安全隐患. PSU: Patch Set Up ...

  2. thymeleaf 之 th:each迭代循环对象集合

    thymeleaf 之 th:each迭代循环对象集合 2018年02月24日 14:32:31 阅读数:1382 th:each属性用于迭代循环,语法:th:each="obj,iterS ...

  3. linux中grep工具

    正则表达式 以前我们用grep在一个文件中找出包含某些字符串的行,比如在头文件中找出一个宏定义.其实grep还可以找出符合某个模式(Pattern)的一类字符串.例如找出所有符合xxxxx@xxxx. ...

  4. FireMoneky 画图 Point 赋值

    VCL 的 Canvas.Pen 对应FMX: Canvas.Stroke;VCL到 Canvas.Brush 对应FMX: Canvas.Fill. TCircle 圆形控件 Inkscape 0. ...

  5. How do I prevent Eclipse from hanging on startup?

    Under Eclipse 3.6 (Helios), the corresponding file seems to be .metadata/.plugins/org.eclipse.core.r ...

  6. FORALL用法小结

    本文主要翻译.整理了ORACLE官方文档上有关FORALL的部份内容,不妥之处,还希望多和大家交流. 在发送语句到SQL引擎前,FORALL语句告知PL/SQL 引擎批挷定输入集合.尽管FORALL语 ...

  7. eval函数的使用之一

    把从后台传到前端的json格式的字符串转成json success: function(data){ var json =eval("("+data+")"); ...

  8. TIME_WAIT和CLOSE_WAIT状态区别

    [TIME_WAIT和CLOSE_WAIT状态区别] 常用的三个状态是:ESTABLISHED 表示正在通信,TIME_WAIT 表示主动关闭,CLOSE_WAIT 表示被动关闭. TCP协议规定,对 ...

  9. spring 控制反转与依赖注入原理-学习笔记

    在Spring中有两个非常重要的概念,控制反转和依赖注入:控制反转将依赖对象的创建和管理交由Spring容器,而依赖注入则是在控制反转的基础上将Spring容器管理的依赖对象注入到应用之中: 所谓依赖 ...

  10. 2015年传智播客JavaEE 第168期就业班视频教程day45-ERP项目-01 10-类图结构分析设计

    运行astah-pro.bat,这是windows下运行的.astah-run.sh是Linux下运行的. 类结构视图的作用是描述类模型和模型与模型之间的关系,也就是说我们在这要把这个一对多和多对多的 ...