March 6, 2018 at 8:55 am
I have a scenario where a production SQL server appears to be completely clearing both the plan and buffer caches on a regular basis.
From the sys.dm_exec_query_stats and sys.dm_exec_procedure_stats DMVs I can see that plan cache is being cleared and monitoring the Cache Hit Ratio counter in Performance Monitor shows an average (over a typical day) of under 60%. Furthermore I can see that the Page Life Expectancy drops to 0 approximately every 30 minutes before climbing steadily back up and then dropping back down again. This happens regardless of workload. At the same time there are comparatively few Free List Stalls/sec (average of 0.014) and the Memory Manager \ Free Memory (KB) counter never hits 0 (averaging at 620MB).
I have been advised to use Extended Events to try and identify the culprit but have never used XE in anger before. Can anyone suggest what events I should be capturing to help me troubleshoot this issue?
The version of SQL Server I am using is Microsoft SQL Server 2014 (SP2-GDR) (KB4019093) - 12.0.5207.0 (X64)
March 6, 2018 at 9:19 am
I'd probably start with sql_batch_completed and rpc_completed and see if I could figure out what statements were being run at the time the problems happen.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 6, 2018 at 6:58 pm
There is a possibility some person with high enough privs created a job or proc or has a habit of running either DBCC FREEPROCCACHE or DBCC DROPCLEANBUFFERS.
March 7, 2018 at 12:55 am
Thank you both, I'll have a look at those events and see if I can see any statements being run that could be responsible.
March 7, 2018 at 1:02 am
The events I suggested aren't just for seeing whether someone ran dropcleanbuffers. If the cause is not so obvious, it's still going to be related to what's running at the time.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 8, 2018 at 1:14 am
Thank you both for your help! Using XE to capture batch and RPC complete events whilst monitoring for PLE drops in performance monitor allowed me to identify a pair of queries that were responsible for the high churn on the buffer cache.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply