Tempdb--Allocation Bottleneck
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的更多相关文章
- Tempdb--monitoring and troubleshooting
TempDB用来存放临时表.全局临时表.表变量以及排序或HASH等操作引发的中间结果集 TempDB在每次实例重启时重新创建,TempDB数据库文件的初始化大小取决于Model数据库的文件大小或显示A ...
- Tempdb--TempDB Basic
1. TempDB只能运行在Simple Recovery Model下 2. 由于TempDB不需要Recovery,因此在TempDB中发生的操作不需要REDO,因此在日志记录上有别于其他数据库. ...
- SQL Server 2008性能故障排查(四)——TempDB
原文:SQL Server 2008性能故障排查(四)--TempDB 接着上一章:I/O TempDB: TempDB是一个全局数据库,存储内部和用户对象还有零食表.对象.在SQLServer操作过 ...
- Expert 诊断优化系列------------------给TempDB 降温
前面文章针对CPU.内存.磁盘.语句.等待讲述了SQL SERVER的一些基本的问题诊断与调优方式.为了方便阅读给出导读文章链接方便阅读: SQL SERVER全面优化-------Expert fo ...
- 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 我试着执行该存储过程,结果出现下面错误,每次执行该存储过程,得 ...
- SQLSERVER中的ALLOCATION SCAN和RANGE SCAN
SQLSERVER中的ALLOCATION SCAN和RANGE SCAN 写这篇文章的开始,我还不知道ALLOCATION SCAN的工作原理是怎样的,网上资料少得可怜 求助了园子里的某位大侠,他看 ...
- 第23/24周 临时数据库(TempDb)
在今天的性能调优培训里我们讨论下TempDb——SQL Server的公共厕所,在SQL Server里我是这样描述它的.我们的每个人都会经常使用TempDb.有些人直接使用它,有些人不直接使用它.今 ...
- SQL Server 2016里TempDb的提升
几个星期前,SQL Server 2016的最新CTP版本已经发布了:CTP 2.4(目前已经是CTP 3.0).这个预览版相比以前的CTP包含了很多不同的提升.在这篇文章里我会谈下对于SQL Ser ...
- Tempdb的并发阻塞
9.3 Tempdb的并发阻塞 在介绍Tempdb的并发问题前,先介绍几个比较特殊的数据页. PFS(Page Free Space),用于标识数据页空间的使用情况,以字节标识,可以表示数据页使用百分 ...
随机推荐
- Tornado模板转义处理
转自:http://www.qttc.net/201305320.html tornado默认是转义所有字符,比较安全,但有时候我们的确需要把字符当做html来解析处理,因此我们需要做些处理. 示例: ...
- Python中小整数对象池和大整数对象池
1. 小整数对象池 整数在程序中的使用非常广泛,Python为了优化速度,使用了小整数对象池, 避免为整数频繁申请和销毁内存空间. Python 对小整数的定义是 [-5, 256] 这些整数对象是提 ...
- 线程的等待方法:join
其实多线程最复杂的地方在于不同线程间的同步问题,这其中会涉及到先后执行问题.共享变量问题等.这篇文章我们主要来开个头,看一下join方法. using System; using System.Thr ...
- 使用Fiddler实现网络限速
Fiddler实现网络限速方法: 1.点击FiddlerScript 2.在脚本里相应的地方添加“2”处两行代码(不加注释),保存(Save Script) 第一行为请求延时3秒,第二行为响应延时1. ...
- 添加自己的discuz 的积分策略
在参考了网上的一些文章和discuzx开发手册,开始操作:1.在数据库表pre_common_credit_rule增加一条记录,rulename填“填写推荐人”,action填“txtjr”(跟下面 ...
- WMI获取计算机信息
On Error Resume NextstrComputer = "."strInfo = ""Set objWMIService = GetObject(& ...
- auto_ptr 浅析(转)
auto_ptr是C++标准库中(<utility>)为了解决资源泄漏的问题提供的一个智能指针类模板(注意:这只是一种简单的智能指针) auto_ptr的实现原理其实就是RAII,在构造的 ...
- 【转载】Javascript里面的线程和异步
JavaScript引擎是单线程运行的,浏览器无论在什么时候都只且只有一个线程在运行JavaScript程序. 参考这篇文章 http://www.ruanyifeng.com/blog/2012/1 ...
- etcd 命令行
比较重要的配置 -name 节点名称,默认是UUID-data-dir 保存日志和快照的目录,默认为当前工作目录-addr 公布的ip地址和端口. 默认为127.0.0.1:2379-bind-add ...
- for 续1
--------siwuxie095 /f 是四个参数中最复杂的一个,非常强大,不过其复杂性 令人望而生畏 /f 用途: 能够对字符串进行操作,也能够对命令的返 ...