SQL Server等待事件—PAGEIOLATCH_EX
什么是PAGEIOLATCH_EX等待事件? 下面我们将对PAGEIOLATCH_EX等待事件的相关资料做一个简单的归纳、整理。关于PAGEIOLATCH_EX,官方文档的简单介绍如下:
PAGEIOLATCH_EX:
Occurs when a task is waiting on a latch for a buffer that is in an I/O request. The latch request is in Exclusive mode. Long waits may indicate problems with the disk subsystem.
在任务等待 I/O 请求中缓冲区的闩锁时发生。 闩锁请求处于“独占”模式。 长时间的等待可能指示磁盘子系统出现问题。
In SQL Server, a latch is a short-term lightweight synchronization object.
Buffer latches including the PAGEIOLATCH_EX wait type are used to synchronize access to BUF structures and associated pages in the SQL Server database. The most frequently occurring buffer latching situation is when serialization is required on a buffer page. These buffer latches are not held for the complete period of the transaction. The PAGEIO latches are a subset of BUF latches used when the buffer and associated data page or the index page is in the middle of an IO operation. PAGEIOLATCH wait types are used for disk-to-memory transfers.
在SQL Server中,闩锁是短暂的轻量级同步对象。
缓冲区闩锁(包括PAGEIOLATCH_EX等待类型用于同步访问SQL Server 数据库中的 BUF 结构和关联页。最常见的缓冲区闩锁情况是在缓冲区页面上需要序列化操作时。这些缓冲区闩锁不会在事务的整个期间内保持不变。PAGEIO闩锁是缓冲区和相关数据页或索引页处于 IO 操作中间时使用的 BUF闩锁的子集。PAGEIOLATCH 等待类型用于磁盘到内存的传输。
PAGEIOLATCH_EX (exclusive mode page IO latch request)
When a SQL Server user needs a page that is not in buffer cache, the database must first allocate a buffer page, and then puts an exclusive PAGEIOLATCH_EX latch on the buffer while the page is transferred from disk to cache. During this operation SQL Server puts a PAGEIOLATCH_EX request on the buffer on behalf of the user. After the write to cache is complete, the PAGEIOLATCH_EX latch is released.
当SQL Server用户需要不在缓冲区高速缓存中的相关页面时,数据库必须首先分配一个缓冲区页面,然后在页面从磁盘传输到高速缓存时,在缓冲区上放置一个独占PAGEIOLATCH_EX闩锁。 在此操作过程中,SQL Server 代表用户在缓冲区上发出PAGEIOLATCH_EX请求。写入高速缓存完成后,将释放PAGEIOLATCH_EX闩锁。
Problem indication
Excessive PAGEIOLATCH_EX waits occur when data is transfered from disk to memory for update operations and these transfers take time to complete.
This may be an indication of disk contention or other disk subsystem bottlenecks.
当数据从磁盘传输到内存中以进行更新操作时,将出现大量的PAGEIOLATCH_EX等待,并且这些传输(磁盘IO操作)需要时间才能完成。这可能表明存在磁盘争用或其他磁盘子系统瓶颈。
PS:其实当一个大表发生大量数据删除操作时,也会出现大量的PAGEIOLATCH_EX等待事件。
Description:
This wait type is when a thread is waiting for the read of a data file page from disk to complete, and the thread is going to modify the page structure once it is in memory (EX = EXclusive mode). The Latches Whitepaper in the sidebar on the right has a description of all latch modes and their compatibility with other latch modes.
(Books Online description: “Occurs when a task is waiting on a latch for a buffer that is in an I/O request. The latch request is in Exclusive mode. Long waits may indicate problems with the disk subsystem.”)
这种等待类型是线程正在等待从磁盘读取数据文件的相关页面到内存的完成,并且一旦线程将修改内存中的页面结构(EX = EXclusive模式)。 右侧边栏中的“闩锁白皮书”介绍了所有闩锁模式及其与其他闩锁模式的兼容性。
(在线丛书描述:“当任务正在等待I / O请求中的缓冲区的闩锁上时发生。闩锁请求处于互斥模式。长时间等待可能表明磁盘子系统有问题。”)
PAGEIOLATCH_EX
A query is waiting for exclusive write access to a page in order to add data to the page, but the page is not currently in memory and has to be loaded from disk.
Page latches are lightweight, non-configurable locks used by internal processes within SQL Server to manage access to the page buffer in memory. When SQL Server has to read pages from the disk into the memory buffer or from the buffer out to disk, it must place latches on the buffer pages while the processes take place.
It’s normal to see some PAGEIOLATCH_* waits, but if you’re frequently seeing them with wait times consistently above 10 milliseconds and you’re experiencing some type of latency, it suggests that the I/O subsystem is under pressure. Conversely, if you see many brief waits, you may be affected by increased I/O activity.
查询正在等待对页面的独占写入访问,以便将数据添加到页面,但是该页面当前不在内存中,必须从磁盘加载。
闩锁是SQL Server 内部进程用于管理对内存中页面缓冲区的访问的轻量级、不可配置的锁。当SQL Server必须将磁盘中的页面读取到内存缓冲区中或从缓冲区中读取到磁盘时,它必须在进程进行时将闩锁放在缓冲区页面上。
看到一些PAGEIOLATCH_ *等待是很正常的,但是如果您经常看到它们的等待时间始终超过10毫秒,并且遇到某种类型的延迟,则表明I/O子系统面临压力。 相反,如果您看到许多短暂的等待,则可能会受到I/O活动增加的影响。
参考资料:
https://logicalread.com/2012/11/12/sql-server-pageiolatch_ex-wait-type/#.XkH2KCIzaHs
https://www.sqlskills.com/help/waits/pageiolatch_ex/
SQL Server等待事件—PAGEIOLATCH_EX的更多相关文章
- [翻译]SQL Server等待事件—THREADPOOL
前言: 本文是对SQLSkills上一篇关于SQL Server中THREADPOOL等待的博客的翻译,本文也不是完全翻译,有些地方适当加入了自己的一些认知.如有翻译不对或不好的地方,敬请指出,大 ...
- SQL Server等待事件—RESOURCE_SEMAPHORE_QUERY_COMPILE
等待事件介绍 关于等待事件RESOURCE_SEMAPHORE_QUERY_COMPILE,官方的介绍如下: Occurs when the number of concurrent query co ...
- SQL Server等待事件新解
资源等待类型 并行:CXPACKET Buffer:PAGEIOLATCH_X 非Buffer:LATCH_X I/O:ASYNC_IO_COMPITION:IO_COMPITION CPU:SOS_ ...
- [转载]sql server 等待类型
下表列出各任务所遇到的等待类型. 等待类型 说明 ASYNC_DISKPOOL_LOCK 当尝试同步并行的线程(执行创建或初始化文件等任务)时出现. ASYNC_IO_COMPLETION 当某任务正 ...
- sql server等待类型
sql server 各种等待类型-转 sql server各个等待类型及解决办法:https://www.sqlskills.com/help/waits/writelog/其他等待类型的描述和解决 ...
- SQL Server 扩展事件(Extented Events)从入门到进阶(4)——扩展事件引擎——基本概念
本文属于 SQL Server 扩展事件(Extented Events)从入门到进阶 系列 在第一二节中,我们创建了一些简单的.类似典型SQL Trace的扩展事件会话.在此过程中,介绍了很多扩展事 ...
- SQL Server扩展事件-- 使用system_health默认跟踪会话监控死锁
SQL Server扩展事件(Extended Events)-- 使用system_health默认跟踪会话监控死锁 转自:http://blog.51cto.com/ultrasql/160037 ...
- SQL Server扩展事件system_health会话总结
system_health会话概念 我们知道扩展事件(Extended Events)是从SQL Server 2008开始引入的.system_health会话是SQL Server默认包含的扩展事 ...
- SQL Server 扩展事件(Extented Events)从入门到进阶(1)——从SQL Trace到Extented Events
由于工作需要,决定深入研究SQL Server的扩展事件(Extended Events/xEvents),经过资料搜索,发现国外大牛的系列文章,作为“学习”阶段,我先翻译这系列文章,后续在工作中的心 ...
随机推荐
- 看透Spring MVC:源代码分析与实践 (Web开发技术丛书)
第一篇 网站基础知识 第1章 网站架构及其演变过程2 1.1 软件的三大类型2 1.2 基础的结构并不简单3 1.3 架构演变的起点5 1.4 海量数据的解决方案5 1.4.1 缓存和页面静态化5 1 ...
- 最近面试 有人问 sqlite 用过么 sqlite 不是 嵌入式的 开发 么 难道最近还 web开发 了?
找了一个 sqlite expert 安装了一下
- openpyxl库实现对excel文档进行编辑(追加写入)
首先,这个库只支持xlsx格式的excel文件 预期,对”excel_test.xlsx“的A1单元格写入”hello word“ 1.安装”openpyxl“库,pip install openpy ...
- Intellij IDEA中将打开的代码与类文件进行关联
Intellij IDEA中在导航栏打开多个类时,如何快速定位到某个类所在的目录? 经过研究,可以通过以下设置完成: 设置完成后,点击导航栏中的类,左边的Project导航就可以快速定位到该类所在的目 ...
- 科普文,搭建python开发环境
Python简介!首先,是一门面向对象的程序设计语言,先说3个优点!1.有条理,简单,易学,易用.2.强大!可以把其他编程语言制作的模块利用起来.3.拥有丰富的库.Python作为高级编程语言,拥有的 ...
- String字符串性能优化的几种方案
String字符串是系统里最常用的类型之一,在系统中占据了很大的内存,因此,高效地使用字符串,对系统的性能有较好的提升. 针对字符串的优化,我在工作与学习过程总结了以下三种方案作分享: 一.优化构建的 ...
- 基于Flask框架搭建视频网站的学习日志(三)之原始web表单
基于Flask框架搭建视频网站的学习日志(三)1.原始Web 表单 本节主要用于体验一下前端后端直接数据的交互,样例不是太完善,下一节会加入Flash处理,稍微完善一下页面 (备注:建议先阅读廖雪峰老 ...
- C++ 强制类型转换详解
类型转换只不过是让编译器以另外一种方式解释一块内存而已.C++兼容C语言的强制类型转换方式,同时也提供了新型的基于模板的类型转换方式,来提供更多的安全性. 一.C风格的强制类型转换 double k ...
- 阿里云Redis性能测试结果(1个集合存300万数据,查询能几秒返回结果)
现状: 1.买了一台主从的阿里云Redis,内存就1GB. 2.查询了阿里云的帮助,没有找到性能相关的说明, 有的也是4GB版本的并发性能 3.提工单问客服 一个集合里有300万数据,单次查询性能大概 ...
- 深入理解计算机系统大作业——程序人生P2P
程序人生P2P 前言 经过一个学期的快乐学习(折磨),计算机系统终于结课了,自认为对于计算机系统算是有了粗浅的理解.为了庆祝结课,顺带总结自己的学习经历(只是为了完成大作业),便通过一个简单的程序he ...