sql库缓存命中率

In SQL Server performance metrics – part 3, we presented some of the SQL Server Buffer Manager metrics. As the SQL Server buffer pool manages data cache, it’s important to monitor various buffer pool metrics as they help identify and solve memory pressure issues

在SQL Server性能指标(第3部分)中 ,我们介绍了一些SQL Server Buffer Manager指标。 由于SQL Server缓冲池管理数据缓存,因此监视各种缓冲池指标非常重要,因为它们有助于识别和解决内存压力问题。

In this article, we will present 2 more Buffer Manager counters – Buffer Cache Hit Ratio and Page Life Expectancy.

在本文中,我们将介绍另外2个Buffer Manager计数器-Buffer Cache Hit RatioPage Life Expectancy

缓冲区高速缓存命中率 (Buffer Cache Hit Ratio)

Buffer Cache Hit Ratio shows how SQL Server utilizes buffer cache

缓冲区高速缓存命中率显示了SQL Server如何利用缓冲区高速缓存

“Percent of page requests satisfied by data pages from the buffer pool” [1]

“缓冲池中的数据页满足的页面请求百分比” [1]

It gives the ratio of the data pages found and read from the SQL Server buffer cache and all data page requests. The pages that are not found in the buffer cache are read from the disk, which is significantly slower and affects performance

它给出了从SQL Server缓冲区缓存中发现和读取的数据页与所有数据页请求的比率。 从磁盘读取缓冲区高速缓存中未找到的页面,这会大大降低速度并影响性能。

Ideally, SQL Server would read all pages from the buffer cache and there will be no need to read any from disk. In this case, the Buffer Cache Hit Ratio value would be 100. The recommended value for Buffer Cache Hit Ratio is over 90. When better performance is needed, the minimal acceptable value is 95. A lower value indicates a memory problem

理想情况下,SQL Server将从缓冲区高速缓存中读取所有页面,并且无需从磁盘读取任何页面。 在这种情况下, 缓冲区高速缓存命中率的值将为100。建议的缓冲区高速缓存命中率的值超过90。当需要更好的性能时,可接受的最小值为95。较低的值表示存在内存问题

The fact that “after a long period of time, the ratio moves very little” [2] explains the biggest disadvantage of this metric. In situations when performance is changing significantly, Buffer Cache Hit Ratio shows little variations, so you cannot be aware of the significance of the change. That’s why other metrics, such as Page Life Expectancy are suggested. Their values can quickly drop or raise, which clearly indicates significant changes that require attention

“经过很长一段时间后,比率几乎没有变化” [2]的事实说明了该指标的最大缺点。 在性能发生显着变化的情况下, 缓冲区高速缓存命中率几乎没有变化,因此您无法意识到更改的重要性。 这就是为什么建议使用其他指标(例如“ 页面寿命预期 ”)的原因。 它们的值可以快速下降或上升,这清楚表明需要注意的重大变化

The same as with other Buffer Manager metrics, it’s value can be obtained from the sys.dm_os_performance_counters view

与其他缓冲区管理器指标相同,可以从sys.dm_os_performance_counters视图获取该值


SELECTobject_name, counter_name, cntr_value
FROM sys.dm_os_performance_counters
WHERE [object_name] LIKE '%Buffer Manager%'
AND [counter_name] = 'Buffer cache hit ratio'

Due to inert behavior of Buffer Cache Hit Ratio, the values it shows can be misleading and it’s recommended to check values of other SQL Server Buffer Manager counters, such as Page Life Expectancy, Free list stalls/sec, Page reads/sec, etc.

由于缓冲区高速缓存命中率的惰性行为,其显示的值可能会产生误导,建议您检查其他SQL Server 缓冲区管理器计数器的值,例如页面寿命期望空闲列表停顿/秒页面读取/秒等。

网页预期寿命 (Page Life Expectancy)

“Duration, in seconds, that a page resides in the buffer pool” [2]

“页面驻留在缓冲池中的持续时间(以秒为单位)” [2]

SQL Server has more chances to find the pages in the buffer pool if they stay there longer. If the page is not in the buffer pool, it will be read from disk, which affects performance. If there’s insufficient memory, data pages are flushed from buffer cache more frequently, to free up the space for the new pages

SQL Server有更多机会在缓冲池中找到页面,如果它们停留的时间更长。 如果该页不在缓冲池中,则会从磁盘读取该页,这会影响性能。 如果内存不足,则会更频繁地从缓冲区高速缓存中刷新数据页,以释放新页的空间。

When there’s sufficient memory on the server, pages have a high life expectancy. The normal values are above 300 seconds (5 minutes) and the trend line should be stable. It’s recommended to monitor the values over time, as frequent quick drops indicate memory issues. Also, a value drop of more than 50% is a sign for deeper investigation

当服务器上有足够的内存时,页面的预期寿命就很高。 正常值高于300秒(5分钟),趋势线应稳定。 建议定期监控这些值,因为频繁的快速删除指示内存问题。 而且,价值下降超过50%表示需要进行更深入的调查

As typical hardware configurations used currently provide more resources, the normal values are often high above 300. If there’s enough memory on the machine, the Page Life Expectancy value will be over 1,000. If the value is below 300, it’s a clear indication that something is wrong

由于当前使用的典型硬件配置可提供更多资源,因此正常值通常会高于300。如果计算机上有足够的内存,则“ 页面预期寿命”值将超过1,000。 如果该值低于300,则表明存在错误

“For example, a server with 230GB RAM allocated to the SQL Server buffer pool and a Page Life Expectancy of 300 would equate roughly to 785MB/sec of I/O activity to maintain the page churn inside of the buffer pool. While it might be possible for the I/O subsystem to keep up with this demand, this represents a significant amount of page churn in the buffer pool” [3]

“例如,为服务器分配230GB RAM到SQL Server缓冲池并且页面预期寿命为300的服务器大约等于785MB / sec的I / O活动,以保持页面在缓冲池中的流失。 尽管I / O子系统可能会满足这种需求,但这表示缓冲池中有大量页面搅动” [3]


SELECT object_name, counter_name, cntr_value
FROM sys.dm_os_performance_counters
WHERE [object_name] LIKE '%Buffer Manager%'
AND [counter_name] = 'Page life expectancy'

The cause for Page Life Expectancy values below 300 can be poor index design, missing indexes, mismatched data types, insufficient memory, etc.

Page Life Expectancy值低于300的原因可能是索引设计不良,索引丢失,数据类型不匹配,内存不足等。

翻译自: https://www.sqlshack.com/sql-server-memory-performance-metrics-part-4-buffer-cache-hit-ratio-page-life-expectancy/

sql库缓存命中率

sql库缓存命中率_SQL Server内存性能指标–第4部分–缓冲区高速缓存命中率和页面寿命期望相关推荐

  1. sql server 内存_SQL Server内存性能指标–第5部分–了解惰性写入,空闲列表停顿/秒和待批内存授予

    sql server 内存 SQL Server performance metrics series with the SQL Server memory metrics that should b ...

  2. sql server 内存_SQL Server内存性能指标–第3部分– SQL Server Buffer Manager指标和内存计数器

    sql server 内存 previous parts of the SQL Server performance metrics series, we presented most importa ...

  3. sql server 内存_SQL Server内存性能指标–第1部分–内存页/秒和内存页故障/秒

    sql server 内存 SQL Server performance basics article, we explained why performance monitoring was imp ...

  4. sql server 内存_SQL Server内存性能指标–第6部分–其他内存指标

    sql server 内存 Memory Manager metrics, the memory pressure can be indicated via the 内存管理器指标,可以通过Buffe ...

  5. sql服务器内存不足_SQL Server内存性能指标–第2部分–可用字节,总服务器和目标服务器内存

    sql服务器内存不足 first part of this series, we started with most important SQL Server performance memory m ...

  6. c统计多线程总时间_SQL Server处理器性能指标–第2部分–处理器:%用户时间,处理器:%特权时间,总时间和线程指标

    c统计多线程总时间 In SQL server processor performance metrics – Part 1 – The most important cpu metrics, we ...

  7. sql数据库性能指标_SQL Server磁盘性能指标–第2部分–其他重要的磁盘性能指标

    sql数据库性能指标 previous part of the SQL Server performance metrics series, we presented the most importa ...

  8. sql数据库性能指标_SQL Server磁盘性能指标–第1部分–最重要的磁盘性能指标

    sql数据库性能指标 memory and 内存和processor metrics. These metrics indicate system and SQL Server performance ...

  9. sql数据库性能指标_SQL Server网络性能指标–最重要的指标

    sql数据库性能指标 The network parameters is the metric category often neglected when troubleshooting SQL Se ...

最新文章

  1. SQLServer On Linux Package List on CentOS
  2. b360装服务器系统,B365主板能不能安装Win7系统 B365和B360主板区别对比介绍
  3. 如何找回误删并清除了回收站的文档
  4. Activity的回调机制---Activity学习笔记(三)
  5. linux优化pdf,linux系统安全和优化.pdf
  6. linux开源游戏_2014年杰出的开源和Linux游戏
  7. [git]git 分支
  8. 《分布式微服务电商源码》-项目简介
  9. python神经网络包_python 神经网络包 NeuroLab
  10. Bezier和B样条曲线
  11. 普通话测试软件字体怎么调整,新版普通话测试管理系统的几个常见问题
  12. 亿万级数据处理的高效解决方案
  13. 程序员这个职业已经不香了吗?从业10年程序员告诉你真实情况
  14. Kettle中“Switch/case“组件的使用
  15. 也测一个PS3111 / HT9530 / AS2258新玩意儿,做个固态U盘?
  16. 软银投资WeWork狂亏47亿美元,报告有史以来最大季度亏损!|一周硅谷热闻
  17. Khan公开课 - 统计学学习笔记 (四)泊松分布 大数定理
  18. 【视觉基础篇】12 # 如何使用滤镜函数实现美颜效果?
  19. 基于瞬时功率理论的APF的SIMULINK模型仿真
  20. How to Get WiFi From a Mile Away

热门文章

  1. php 循环table,php table循环 问题很简单 求帮助
  2. php end array_value,PHP常用处理数组函数
  3. python任务调度系统web_监听调度系统定时执行任务python_websock
  4. python中参数的顺序和sys.argv顺序要一样么_Python中 sys.argv[]的用法简明解释
  5. 创建虚拟目录http://localhost:1780/失败,错误:无法访问iis元数据库。您没用足够的特权访问计算机上的IIS网站...
  6. jquery--动态篇
  7. .net core 使用X509 私钥加密请求
  8. 【Android Developers Training】 20. 创建一个Fragment
  9. 4章 关键的“构建”决策
  10. 求链表是否有环和第一个交点