SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


What Extended Events should I use?


What Extended Events should I use?

Author
Message
Steven Gore
Steven Gore
Valued Member
Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)

Group: General Forum Members
Points: 62 Visits: 50
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)
GilaMonster
GilaMonster
SSC Guru
SSC Guru (919K reputation)SSC Guru (919K reputation)SSC Guru (919K reputation)SSC Guru (919K reputation)SSC Guru (919K reputation)SSC Guru (919K reputation)SSC Guru (919K reputation)SSC Guru (919K reputation)

Group: General Forum Members
Points: 919310 Visits: 48849
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


Ivan R.
Ivan R.
Mr or Mrs. 500
Mr or Mrs. 500 (512 reputation)Mr or Mrs. 500 (512 reputation)Mr or Mrs. 500 (512 reputation)Mr or Mrs. 500 (512 reputation)Mr or Mrs. 500 (512 reputation)Mr or Mrs. 500 (512 reputation)Mr or Mrs. 500 (512 reputation)Mr or Mrs. 500 (512 reputation)

Group: General Forum Members
Points: 512 Visits: 366
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.
Steven Gore
Steven Gore
Valued Member
Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)

Group: General Forum Members
Points: 62 Visits: 50
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.
GilaMonster
GilaMonster
SSC Guru
SSC Guru (919K reputation)SSC Guru (919K reputation)SSC Guru (919K reputation)SSC Guru (919K reputation)SSC Guru (919K reputation)SSC Guru (919K reputation)SSC Guru (919K reputation)SSC Guru (919K reputation)

Group: General Forum Members
Points: 919310 Visits: 48849
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


Steven Gore
Steven Gore
Valued Member
Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)

Group: General Forum Members
Points: 62 Visits: 50
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum









































































































































































SQLServerCentral


Search