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. nc工具用法

    http://man.linuxde.net/nc_netcat nc命令用法举例 什么是nc

  2. http://www.bootcss.com/p/font-awesome/

    集成 将Font Awesome 集成到 Bootstrap 非常容易,还可以被单独使用. 最简单的 Bootstrap + Font Awesome 集成方式 使用这种方式将 Font Awesom ...

  3. sql在外键存在的情况下删除表

    SQL Server 批量 停用/启用 外键约束 今天百度知道上面,看到这样一个要求: 现在有一个库,有很多张表想要删除一张表的记录的时候,由于外键关联太多,所以,没法删除相应的记录,谁能帮忙写个存储 ...

  4. Util-linux-ng-2.17

    yum install -y util-linux-ng 即可安装Util-linux-ng,其中包含了非常多的软件 Util-linux-ng 的内容 安装的程序:addpart, agetty, ...

  5. css字体中英文对照表(转)

     在css文件中,我们常看到有些字体名称变成了乱码,这是由于网页开发者将中文字体的名字直接写成了中文,而css文件本身没有声明字符编码方式,查看时就出现了乱码.为了避免这种乱码状况出现,可以将css文 ...

  6. AngularJS学习笔记(3)——通过Ajax获取JSON数据

    通过Ajax获取JSON数据 以我之前写的与用户交互的动态清单列表为例,使用JSON前todo.html代码如下: <!DOCTYPE html> <html ng-app=&quo ...

  7. asp.net要验证的用户名和密码

    FormsAuthentication.Authenticate()方法要验证的用户名和密码必须存储在Web.config文件内.如果要验证存储在“ASP.NET成员资格数据库”中的密码,则需要调用M ...

  8. oreilly 用户故事地图

    这本书是完全买亏了,一点作用也没有. 整篇有用的字很少,还花了我¥16,总结如下: 用户故事模板: 作为用户角色(who),我想要某项功能(what),这样我可以 XXX(原因,why)

  9. segment_object_model_3d

    * *********************************************************************** * This example program sho ...

  10. java中getAttribute和getParameter的区别

    getAttribute表示从request范围取得设置的属性,必须要先setAttribute设置属性,才能通过getAttribute来取得,设置与取得的为Object对象类型 getParame ...