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

sql server 内存

previous parts of the SQL Server performance metrics series, we presented most important SQL Server memory metrics that indicate overall SQL Server memory pressure. The described metrics show how SQL Server uses memory and physical I/O to store, read and write data pages. In this part, we continue with 在SQL Server性能指标系列的前面部分中 ,我们介绍了最重要SQL Server内存指标,这些指标指示总体SQL Server内存压力。 所描述的指标显示了SQL Server如何使用内存和物理I / O来存储,读取和写入数据页。 在这一部分中,我们继续使用 SQL Server Buffer Manager metrics and memory counters SQL Server缓冲区管理器指标和内存计数器

页面读取/秒 (Page reads/sec)

“Page reads/sec indicates the number of physical database page reads that are issued per second. This statistic displays the total number of physical page reads across all databases. Because physical I/O is expensive, you may be able to minimize the cost, either by using a larger data cache, intelligent indexes, and more efficient queries, or by changing the database design.”[1]

“每秒页读取数表示每秒发出的物理数据库页读取数。 该统计信息显示所有数据库中的物理页面读取总数。 由于物理I / O昂贵,因此您可以通过使用更大的数据缓存,智能索引和更有效的查询,或者通过更改数据库设计来使成本最小化。” [1]

In other words, this shows how many times the pages were read from disk, in a second. Please note that this is not the number of pages read from disk (which is the Pages input/sec metric described below). This is a server-level metric, the number indicates page reads for all databases on the instance

换句话说,这显示在一秒钟内从磁盘读取页面的次数。 请注意,这不是从磁盘读取的页面数(这是下面描述的“页面输入/秒”度量)。 这是服务器级别的指标,该数字表示实例上所有数据库的页面读取

The recommended Page reads/sec value should be under 90. Higher values indicate insufficient memory and indexing issues

推荐的页面读取/秒值应小于90。较高的值表示内存不足和索引问题

The value can be obtained from the sys.dm_os_performance_counters system view

该值可以从sys.dm_os_performance_counters系统视图中获得

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

Page reads/sec value obtained from the system view

页面写入/秒 (Page writes/sec)

The Page writes/sec metric is similar to Page reads/sec and shows the number of times pages were written to disk on the server level

页面写入/秒”度量标准类似于“ 页面读取/秒”,并显示在服务器级别将页面写入磁盘的次数。

“Indicates the number of physical database page writes that are issued per second.”[1]

“指示每秒发出的物理数据库页面写入数。” [1]

The value can be obtained from the sys.dm_os_performance_counters system view

该值可以从sys.dm_os_performance_counters系统视图中获得

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

Page writes/sec value obtained from the system view

Page reads and writes per sec value

The same as Page reads/sec, the recommended value for Page writes/sec is below 90

每秒页面读取次数相同, 每秒 页面写入次数的建议值小于90

High paging and disk I/O activity indicate insufficient memory. If the excessive disk activity is not caused by paging (indicated by normal Page Faults/sec values, compared to the defined metric baseline), Page reads/sec and Page writes/sec will be high. In this situation, it’s recommended to check the Lazy writes/sec and Page Life Expectancy values as well, as the non-zero Lazy writes/sec and low Page Life Expectancy require attention [2]

高页面调度和磁盘I / O活动指示内存不足。 如果过多的磁盘活动不是由分页引起的(由正常的Page Faults / sec值(与定义的度量标准基线相比表示)),则Page reads / secPage writes / sec将很高。 在这种情况下,建议同时检查“ 惰性写入/秒”和“ 页面寿命期望”值,因为非零的“ 惰性写入/秒”和较低的“ 页面寿命”需要引起注意[2]

页面输入/秒和页面输出/秒 (Pages Input/sec and Pages output/sec)

Pages Input/sec and Pages Output/sec are memory counters

页输入/秒页输出/秒是内存计数器

Pages Input/sec is defined as “the number of pages brought in from disk every second. The difference between this value and Page Faults/sec represents soft page faults.”[3]

页输入/秒定义为“每秒从磁盘引入的页数。 此值与“页面错误/秒”之间的差表示软页面错误。” [3]

Pages Output/sec is defined as “the number of pages written to disk every second to make room in the working set of the process for newly faulted pages. If the process modifies the pages, they must be written out. They cannot be discarded.”[3]

每页输出每秒数定义为“每秒写入磁盘的页数,以便为新出现故障的页在进程的工作集中腾出空间。 如果该过程修改了页面,则必须将其写出。 他们不能被丢弃。” [3]

In other words, these metrics show how many of the requested pages not available in memory had to be read from and written to disk in order to resolve hard page faults

换句话说,这些指标表明必须从磁盘读取和写入磁盘中多少个内存中不可用的请求页面才能解决硬页面错误

The Pages/sec metric is the sum of Pages Input/sec and Pages Output/sec. If the Pages/sec value is constantly higher than 50, to confirm that hard page faults are happening, additional investigation is needed. It’s recommended to monitor disk behavior and paging via memory and disk counters, such as Pages Input/sec, Pages Output/sec, Disk Reads/sec, and Avg. Disk Read Bytes/sec

页面/秒”度量标准是“ 页面输入/秒”和“ 页面输出/秒”的总和。 如果“ 页数/秒”值始终高于50,则要确认是否发生硬页错误,需要进行其他调查。 建议通过内存和磁盘计数器(例如, Pages Input / secPages Output / secDisk Reads / secAvg)监视磁盘行为和分页 磁盘读取字节/秒

Another metric that is closely related to Pages Input/sec and Pages Output/sec is Page Faults/sec. It shows both hard and soft page faults. As soft page faults don’t affect SQL Server performance, it’s good to check the Page Reads/sec value first and compare it to Pages Input/sec. If the latter is greater, it indicates a high page fault rate that can be solved by increasing memory designated to SQL Server

Pages / secPages / sec紧密相关的另一个指标是Page Faults / sec 。 它同时显示硬页面错误和软页面错误。 由于软页面错误不会影响SQL Server性能,因此最好先检查“ Page Reads / sec”值并将其与“ Pages Input / sec”进行比较。 如果后者更大,则表明页面错误率很高,可以通过增加指定给SQL Server的内存来解决

Both Pages Input/sec and Pages Output/sec values are recommended to be lower than 10

建议页面输入/秒页面输出/秒的值都小于10

Pages input and output per sec

SQL Server Buffer Manager Page reads/sec and Page writes/sec metrics, and Pages Input/sec and Page Output/sec memory counters help identify and solve performance issues, such as insufficient or inadequately configured memory. They show the number of times the pages were read/written from disk and the total number of pages read/written. The threshold is clearly defined so performance issues can be diagnosed without creating a baseline first

SQL Server Buffer Manager页面读取/秒页面写入/秒的度量,以及页面输入/秒页面输出/秒的内存计数器有助于识别和解决性能问题,例如内存不足或配置不正确。 它们显示了从磁盘读取/写入页面的次数以及读取/写入的页面总数。 明确定义了阈值,因此无需先创建基准即可诊断性能问题

翻译自: https://www.sqlshack.com/sql-server-memory-performance-metrics-part-3-sql-server-buffer-manager-metrics-memory-counters/

sql server 内存

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值