I have inherited a SQL server {2012 (SP3), but this question is intended to be generic} we are using SCOM to monitor it. Previously I was getting an alert once or twice a month for PLE < 300. Now I am getting sometimes 2 or 3 a day.
There are multiple blog posts about PLE, a few tools you can get to monitor it, and many differing opinions about what is good, bad or indifferent. In the end there are a lot of variables. No solutions are one size fits all. Low PLE is not a problem so much as it is a symptom, with lots of potential causes, and related measures to consider.
{this paragraph might not add value to the question, I am open to removing it} I think everyone can agree that PLE falling to 299 once a month during an overnight report creation, is a symptom that does not need to be addressed (assuming the report completes before business hours). Most can also agree that PLE consistently at 350, is not good. There are a handful of cause to look at before making hardware change, with queries and index being near the top.
After reading about a dozen blog posts about PLE. I have tried to narrow down the key symptoms to get a good picture of what is going on. The query below is what I came up with. It gives values for 4 Buffer Manager items that interconnect with PLE
- 'Page life expectancy'
- 'Free list stalls/sec'
- 'Lazy writes/sec'
- 'Buffer cache hit ratio'
...
SELECT [object_name],
[counter_name],
[cntr_value] FROM sys.dm_os_performance_counters -- https://learn.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-os-performance-counters-transact-sql
WHERE [counter_name] = 'Page life expectancy' --if multiple NUMA on a server should return multiple Nodes,
OR [counter_name] = 'Free list stalls/sec' -- Number of requests per second that had to wait for a free page https://learn.microsoft.com/en-us/sql/relational-databases/performance-monitor/sql-server-buffer-manager-object
OR [counter_name] = 'Lazy writes/sec' --Flushes of dirty pages before a checkpoint runs.
OR [counter_name] = 'Buffer cache hit ratio' --percentage of pages found in the buffer cache without having to read from disk you want this ratio to be high
Order by [counter_name] DESC, [object_name];
Additionally if you are looking at Lazy Writes on an inherited server you should check Recovery Interval
EXEC sp_configure @configname='recovery interval (min)'; --The 'config_value' default 0 indicates SQL is applying Checkpoints completely automatically https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-recovery-interval-server-configuration-option
If this first query does not return values:
SELECT COUNT(*) FROM sys.dm_os_performance_counters; --If no values from the firs query, an value of 0 here indicates a seperate issue https://learn.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-os-performance-counters-transact-sql
I have a pretty good idea what all these values represent, and how they work together. I have included comments and sources in my code above.
My question is two part
Is my list of buffer items/values above adequate for a starting place when examining PLE? (i.e. values that will always be helpful to consider together, should something excluded or included)
How to put the values in good context with each other? (i.e. there is a good answer here saying "Check the Free List Stalls/sec value as well. If above 2, consider adding memory to the server" while the body of the answer is helpful, I don't think a value of 2 for 'Free List Stalls/sec' is a problem on most instances)
NOTE: This question is not about solving the PLE issue, it is about how/where to start looking when assessing the symptoms. Your Doctor checks your Pules, Blood Pressure, Respirations, and Temperature at the start of every exam.
Edit 4/13/2018; Attempt to Clarify This is not about knee jerk reactions like checking indexes or waits. This is about identifying other native SQL performance data that should always be examined with PLE. PLE is one of the Buffer Management Objects, what other Buffer Management Objects or Performance Counters should or should not always be part of queries when you really do want to look at buffer management?