简体   繁体   中英

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. 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.

  1. Available Bytes : Free physical memory. Self-explanatory
  2. Pages/sec and Page Faults/sec : 99% clear. 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". Strange. Shouldn't there only be exactly one process associated with SQL Server memory? 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? 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? I presume SQL Server will not grant that much to every instance it is hosting, and will balance itself as needed? 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.

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.

Memory Grants Pending: "the number of processes pending for a memory grant within SQL Server memory".

This is a completely different topic. Read here: Understanding SQL server memory grant .

Target/Total Server Memory

Read SQLOS's memory manager and SQL Server's Buffer Pool . IS a bit old, but is still quite accurate, specially pre-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. 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). This is also why is best to host one instance per host.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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