简体   繁体   English

Perf Mon指标分析

[英]Perf Mon Metrics Analysis

I'm reading the book "SQL Server 2008 Query Performance Tuning Distilled" and found its description of perf mon metrics to be a little vague in some cases. 我正在阅读《蒸馏的SQL Server 2008查询性能调整》这本书,发现在某些情况下对性能指标的描述有些模糊。 I'll list all the metrics it covered, with my sense of each. 我将列出它涵盖的所有指标,以及每个指标的含义。 I'd like to have clarifications shared where necessary. 我想在必要时分享一些说明。 As my comments suggest, it is principally items #2, 6, and 7 I'm looking for help with. 正如我的评论所建议的,我主要是寻求帮助的项目#2、6和7。

  1. Available Bytes : Free physical memory. 可用字节可用物理内存。 Self-explanatory 不言自明
  2. Pages/sec and Page Faults/sec : 99% clear. 页面/秒和页面错误/秒 :清除99%。 The only question is why a page might swap from one location to another in memory (soft fault). 唯一的问题是为什么页面可能在内存中从一个位置交换到另一个位置(软故障)。
  3. Buffer Cache Hit Ratio : How often fresh requested memory is available immediately. 缓冲区高速缓存命中率 :新请求的内存立即可用的频率。 Seems rather clear, although perhaps poorly named. 似乎很清楚,尽管可能命名不佳。 I wonder if instead it should have been called "Buffer Pool Free Hit Ratio". 我想知道它是否应该被称为“缓冲池空闲命中率”。
  4. Page Life Expectancy : This buffer pool cache metric is controlled both by frequency of cache hits and by available memory. 页面预期寿命 :此缓冲池高速缓存度量标准受高速缓存命中的频率和可用内存的控制。 Seems rather clear. 似乎很清楚。
  5. Lazy writes/sec : rate of writing dirty buffers to disk. 延迟写入/秒 :将脏缓冲区写入磁盘的速率。 Seems rather clear. 似乎很清楚。
  6. Memory Grants Pending : "the number of processes pending for a memory grant within SQL Server memory". 未完成的内存授予 :“ SQL Server内存中正在等待内存授予的进程数”。 Strange. 奇怪。 Shouldn't there only be exactly one process associated with SQL Server memory? 难道不应该只有一个进程与SQL Server内存相关联吗? Not clear! 不清楚!
  7. Target/Total Server Memory : It is said "If total server memory is much less than target server memory...then perhaps the max server memory configuration parameter is set too low." 目标服务器/总服务器内存 :据说“如果服务器总内存远小于目标服务器内存...那么最大服务器内存配置参数可能设置得太低。” Somewhat unclear. 有点不清楚。 Why are there two settings - target server memory and max server memory - that govern the sum of SQL server memory usage? 为什么要设置两个设置- target server memorymax server memory -来控制SQL Server内存使用量的总和? Is it because "total" is for all database instances combined, and "max" is for each individual database? 是否因为“总数”是针对所有数据库实例的组合,而“最大值”是针对每个单独的数据库的?

An overall question I have, perhaps related to item #7, is what happens when each database instance is configured for max memory usage that (nearly) totals that of all available physical memory? 我有一个总体问题,也许与项目7有关,当每个数据库实例配置为(几乎)总计所有可用物理内存的最大内存使用量时,会发生什么? I presume SQL Server will not grant that much to every instance it is hosting, and will balance itself as needed? 我猜想SQL Server不会为它托管的每个实例提供那么多的费用,并且会根据需要平衡自身? Is it more complex than that? 比这还复杂吗?

The only question is why a page might swap from one location to another in memory (soft fault). 唯一的问题是为什么页面可能在内存中从一个位置交换到另一个位置(软故障)。

A soft fault does not really move the page. 软故障不会真正移动页面。 The process working set is contiguously being trimmed and pages are placed in 'standby' state . 连续修剪流程工作集,并将页面置于“备用” 状态 They retain the very same physical location, but their descriptor in the kernel gets marked as 'standby'. 它们保留了完全相同的物理位置,但是它们在内核中的描述符被标记为“备用”。 A process referencing this page will incur a 'soft fault', meaning the page descriptor gets 'fixed' and the page gets back into the process working set. 引用该页面的流程将产生“软故障”,这意味着页面描述符被“修复”,并且页面返回到流程工作集中。 Never, during this entire process of trimming and soft fault, is the content of the page actually moved in the physical RAM. 在修整和软故障的整个过程中,从不将页面的内容实际移动到物理RAM中。

Buffer Cache Hit Ratio: How often fresh requested memory is available immediately 缓冲区高速缓存命中率:新请求的内存立即可用的频率

No, it means how many requests for a DB page found the page in memory and did not have to issue an IO to fetch it from disk. 不,这意味着有多少个数据库页面请求在内存中找到该页面,而不必发出IO来从磁盘中获取该页面。

Memory Grants Pending: "the number of processes pending for a memory grant within SQL Server memory". 未完成的内存授予:“ SQL Server内存中正在等待内存授予的进程数”。

This is a completely different topic. 这是一个完全不同的主题。 Read here: Understanding SQL server memory grant . 在这里阅读: 了解SQL Server内存授予

Target/Total Server Memory 目标/总服务器内存

Read SQLOS's memory manager and SQL Server's Buffer Pool . 阅读SQLOS的内存管理器和SQL Server的缓冲池 IS a bit old, but is still quite accurate, specially pre-SQL Server 2012. 虽然有些陈旧,但仍然相当准确,特别是在SQL Server 2012之前。

what happens when each database instance is configured for max memory usage that (nearly) totals that of all available physical memory 当每个数据库实例配置为(几乎)总计所有可用物理内存的最大内存使用量时,会发生什么情况

This is the expected operation mode for SQL Server. 这是SQL Server的预期操作模式。 It is designed to capture all the memory on the host and then manage it for itself. 它旨在捕获主机上的所有内存,然后自行对其进行管理。 This is why is not indicated to host any other process along with SQL Server (eg. no IIS, no Exchange, no AD domain controller, no SSIS, no RS, no AS etc). 这就是为什么未指示与SQL Server一起托管任何其他进程(例如,没有IIS,没有Exchange,没有AD域控制器,没有SSIS,没有RS,没有AS等)。 This is also why is best to host one instance per host. 这也是为什么最好每台主机托管一个实例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM