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),用于标识数据页空间的使用情况,以字节标识,可以表示数据页使用百分 ...
随机推荐
- WebDriverAgent原理
传输层:HTTP/HTTPS/HSF/Socket 安全性:HTTP/HTTPS 功能.单元 性能-限流.加服务器 目的:稳定的服务的TPS摸高测试(短时间的极限,不可持续) API接口测试-施压-服 ...
- CentOS开机自启动
CentOS 配置的开机自启动. vim /etc/rc.local #!/bin/sh # # This script will be executed *after* all the other ...
- Windows Git 服务器 客户端 Delphi Git配置
装Git后本地单机版就有了版本管理功能. git 使用记录 git 客户端 这2个工具足够用. git for windows,http://git-scm.com/download/,Git-1.9 ...
- java 序列化时排除指定属性
java 序列化对象如何排除指定属性呢? java 中序列化对象有多种方式:struts2 ,jackson,json-lib (1)使用struts2 json插件 依赖的jar包:struts2- ...
- 模板引擎 引自 《PHP核心技术与最佳实践》
随着web的发展,仅一门语言或者一种技术已经不能满足需求,分层架构显得越来越重要.在大型架构中,从来不会简单地应用php从头到尾实现一个完整的mvc架构.可能底层是c/java的支撑,负责密集运算和y ...
- swagger2 注解整体说明
@Api:用在请求的类上,表示对类的说明 tags="说明该类的作用,可以在UI界面上看到的注解" value="该参数没什么意义,在UI界面上也看到,所以不需要配置&q ...
- sql注入及事务
Statement会有一个关于sql注入的bug ,所以基本不使用 一般使用PreparedStatement import java.sql.Connection;import java.sql.P ...
- Go and Beego Development
1. Beego wiki in en and cn https://beego.me/ For API development: https://beego.me/blog/beego_api 2. ...
- tomcat 403 forbidden
server.xml和tomcat-users.xml都是设置于过了,还是403,最后发现context.xml中多了一行 <Valve className="org.apache.c ...
- Visual Studio 2013 osg
1>------ Rebuild All started: Project: ZERO_CHECK, Configuration: Debug x64 ------1> Checking ...