What Extended Events should I use?

  • 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)

  • 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

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • 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.

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

  • 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

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • 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