Using Extended Events to Diagnose Application Issues

Slides:



Advertisements
Similar presentations
SQL Server 2012 New Performance Tuning Tools. Who am I? Menzo Steinhorst Senior Premier Field Engineer SQLRAP, WS+ SQL Server Performance Tuning, WS+
Advertisements

Module 17 Tracing Access to SQL Server 2008 R2. Module Overview Capturing Activity using SQL Server Profiler Improving Performance with the Database Engine.
Virtual techdays INDIA │ 9-11 February 2011 virtual techdays Auditing Made Easy: Change Tracking and Change Data Capture Pinal Dave │ Technology Evangelist,
SQL Server Performance Audit and Tuning Jason Pack.
DAT308 SQL Server 2000 Profiler: The Database Programmer's Best Friend Fernando G. Guerrero S olid Q uality L earning
How a little code can help with support.. Chris Barba – Developer at Cimarex Energy Blog:
Key Concepts About Performance Factors Affecting SQL Performance SQL Performance Tuning Methodologies SQL Performance Tuning Tools 1.
Data: Migrating, Distributing and Audit Tracking Michelle Ayers, Advisory Solution Consultant
Vidas Matelis, Toronto SQL Server User Group November 13, 2008.
Danette Dineen Riviello Magellan Health March 17,
How to solve a SQL performance problem Paul Zgondea.
DMV Performance Monitoring & Tuning Presented by Franklin Yamamoto.
Learningcomputer.com SQL Server 2008 – Profiling and Monitoring Tools.
SQLRX – SQL Server Administration – Tips From the Trenches SQL Server Administration – Tips From the Trenches Troubleshooting Reports of Sudden Slowdowns.
R7 Integrator and Enterprise Integrator: You won’t believe this is XA… Deborah Vermillion, VP Consulting Services, CPIM, CIRM Belinda Daub, Senior Consultant.
The X-Factor of the Extended Events Amit Khandelwal.
EOH: A Microsoft Partner INTRODUCTION TO EXTENDED EVENTS.
Auditing In SQL Server SQL Saturday #521 – Atlanta Presented By Brad McKuhen.
SQL Advanced Monitoring Using DMV, Extended Events and Service Broker Javier Villegas – DBA | MCP | MCTS.
Using Correlated Tracing to Diagnose Query Level Performance What’s slowing down my app? Jerome Halmans Senior Software Development Engineer Microsoft.
Improve query performance with the new SQL Server 2016 query store!! Michelle Gutzait Principal Consultant at
Auditing In SQL Server SQL Saturday #506 – Baltimore, BI Edition Presented By Brad McKuhen.
SQL Saturday #509 | Brisbane 2016 #509 | Brisbane 2016 Martin Catherall Moving from Profiler to Extended Events.
3 Methods to End the Madness
With Temporal Tables and More
Benchmarking like a PRO
SQL Saturday – Performance Troubleshooting
A big party is being held to honor relational database systems and their impact on modern society. Outside the venue, the host awaits the guests. The.
Extended Events
Hilary Cotter Extended Events.
Building a Performance Monitoring System using XEvents and DMVs
Become a SQL Server Performance Detective
Troubleshooting SQL Server When You Cannot Access The Machine
Art of War With Bad Code Andrew J. Kelly
T-SQL Coding Techniques Are you playing with fire?
Understanding & Using Spatial Data Features in SQL Server
Anything But, Troubleshooting when it’s not SQL Server
Building a Performance Monitoring System using XEvents and DMVs
Become a SQL Server Performance Detective
SQL Server Monitoring Overview
Simplifying XEvents Management with dbatools
Auditing in SQL Server 2008 DBA-364-M
Performance Monitoring Using Extended Events, DMVs & Query Store
Introducing the SQL Server 2016 Query Store
Building a Performance Monitoring System using XEvents and DMVs
The Ins and Outs of Indexes
The Ins and Outs of Indexes
TSQL Coding Techniques
Wellington, SQLSaturday#706
SQL Server 2016 Query Data Store
The Ins and Outs of Indexes
When query plans go wrong
SQL Server Performance Tuning Nowadays
Modeling scenarios for DAX
Hidden Gems of SQL Server 2016
Targeting Wait Statistics with Extended Events
SPC Developer 1/18/2019 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Moving from SQL Profiler to xEvents
Kris Hokanson That’s bad mmmkay! …Or, how to know when your SQL Server isn’t working as well as it could.
Summit Nashville /3/2019 1:48 AM
The Ins and Outs of Indexes
Power BI Streaming Datasets with MS Flow
Analyzing Performance Problems Using XEvents, DMVs & Query Store
Building a Performance Monitoring System using XEvents and DMVs
Disaster Recovery Done Dirt Cheap Founder Curnutt Data Solutions
Using wait stats to determine why my server is slow
Extended Events: Successful troubleshooting recipes
Efficient and Effective coding of stored procedures
Analyzing Performance Problems Using XEvents, DMVs & Query Store
The Ins and Outs of Indexes
Presentation transcript:

Using Extended Events to Diagnose Application Issues Mind the Gap Using Extended Events to Diagnose Application Issues Mindy Curnutt Partner Mindy Curnutt & Associates Consulting

About Me Wife & Mother Busy-Bee Musician Soap Making Baking Crocheting Entrepreneur Event Planning

About Me Independent Consultant 4X MS Data Platform MVP Idera ACE 2017 SQL Server since 6.5 / 1995 (20+ Years) SQLPASS Speaker, 2005, 2012-2015, 2017 PASS Program Manager 2015-2017 Twitter: @sqlgirl Email: mindy@mindycurnutt.com

AGENDA Overview Profiler or Extended Events? Long Running Queries A Thousand Paper Cuts The Sounds of Silence Summary

OVERVIEW When to use How to Use Long Running Queries Profiler or Extended Events When to use How to Use 3 Methods Long Running Queries A Thousand Paper Cuts The Sounds of Silence

AGENDA Overview Profiler or Extended Events? Long Running Queries A Thousand Paper Cuts The Sounds of Silence Summary

PROFILER TRACE Less Than 200 Events Heavier than XEvents No New Events after SQL 2008 Deprecated by Microsoft Easier to Use prior to SQL 2012

PROFILER VS EXTENDED EVENTS Like Profiler's Older Brother (or Sister!) - Bigger, More Mature, More Versatile Lighter Weight Easy to use with SQL 2012+

PROFILER VS EXTENDED EVENTS Version Events GUI Adoption 20008 254 No Low 2008R2 263 2012 596 Yes Low-Medium 2014 815 Medium 2016 1303

EVENTS TO TRACK Profiler Extended Events 10 - RPC:Completed sqlserver.rpc_completed 12 - SQL:BatchCompleted sqlserver.sql_batch_completed 45 - SP:StmtCompleted sqlserver.sp_statement_completed

SP_Statement_Completed Default=Black / Additional=Red Extended Events Profiler Columns SP_Statement_Completed SQL_Batch_Completed RPC_Completed 1 textdata statement batch_text 3 databaseid source_database_id database_id 4 transactionid transaction_id 5 linenumber line_number   6 ntusername nt_username 8 hostname client_hostname 10 applicationname client_app_name 11 loginname server_principal_name 12 spid session_id 13 duration duration 14 starttime 15 endtime timestamp 16 reads logical_reads physical_reads 17 writes writes 18 cpu cpu_time 22 objectid object_id 26 servername server_instance_name 27 eventclass name 34 objectname object_name 35 databasename database_name 48 rowcounts row_count

AGENDA Overview Profiler or Extended Events? Long Running Queries A Thousand Paper Cuts The Sounds of Silence Summary

LONG RUNNING QUERIES Resource Consumers Blockers Easy to Spot Low Hanging Fruit?

LONG RUNNING QUERIES When Useful? Occasional Slowness Blocking Issues Specific Application Area Slowness No Budget for 3rd Party Tools After the Fact Analysis Need Drill Down (Stmt within Proc)

LONG RUNNING QUERIES Events to Capture RPC: Completed SQL Batch: Completed SP: Statement Completed Filter Duration > X (example: 5 seconds*) Length of Trace Long (Can run daily, all day) Performance Hit Low

LONG RUNNING QUERIES Profiler Demo Capture Review XEvents Demo

AGENDA Overview Profiler or Extended Events? Long Running Queries A Thousand Paper Cuts The Sounds of Silence Summary

A THOUSAND PAPER CUTS Like Being Buried Alive by Pebbles! Problem: Many, Many Individually Quick Statements RBAR – “Row by Agonizing Row”

A THOUSAND PAPER CUTS Resource Consumers Takes Analysis to Spot Diagnosis may require causing temporary Performance Degradation Typical Causes: A Data Access Layer writing SQL code Non Set-Based SQL Scalar Functions Trigger that fire other Triggers

A THOUSAND PAPER CUTS When Useful? Specific Application Area Slowness Working Directly with User or QA No Budget for 3rd Party Tools Long Running Query Approach Comes Up Dry

A THOUSAND PAPER CUTS Events to Capture RPC: Completed SQL Batch: Completed Filter Duration Filter = 0 (be careful!) User Specific Item (spid, login name…) Length of Trace Very Short Performance Hit High

A THOUSAND PAPER CUTS Profiler Demo Capture Review XEvents Demo

AGENDA Overview Profiler or Extended Events? Long Running Queries A Thousand Paper Cuts The Sounds of Silence Summary

The sounds of silence SQL not responsible for the Slowness being experienced. Problem: User experience is poor SQL utilization low LRQ Traces show nothing TPCs are minimal Is something causing delay between SQL calls? Waitstats will not show this

The sounds of silence Takes Analysis & Intuition to Spot Diagnosis may require causing temporary Performance Degradation Typical Causes: WAN Firmware Overloaded Application Host Application making a synchronous call to something else

The sounds of silence Specific Application Area Slowness When Useful? Specific Application Area Slowness Working Directly with User or QA No Budget for 3rd Party Tools Long Running Query Approach Comes Up Dry Thousand Paper Cut Analysis Comes Up Dry Waitstats look fine

The sounds of silence Scenario 1: Latency Duration % of Time User Experience 308ms 100% SQL Queries 14ms 5% SQL Waiting 294ms 95%

The sounds of silence Scenario 2: Pauses within the Application Duration % of Time User Experience 310ms 100% SQL Queries 13ms 5% SQL Waiting 297ms 95%

The sounds of silence Events to Capture RPC: Completed SQL Batch: Completed Filter Duration Filter = 0 (be careful!) User Specific Item (spid, login name…) Length of Trace Very Short Performance Hit High

The sounds of silence Profiler Demo Review XEvents Demo

AGENDA Overview Profiler or Extended Events? Long Running Queries A Thousand Paper Cuts The Sounds of Silence Summary

sUMMARY LRQ = Long Running Query TPC = Thousand Paper Cuts SOS = Sounds of Silence   LRQ TPC SOS Diagnosis Easy Hard Occasional Slowness? Yes No Specific Slowness? Maybe Capture Baseline or History Filter On Duration User Length of Trace Long Short Performance Hit Low High

QUESTIONS? Mindy Curnutt Independent Consultant w: www.mindycurnutt.com e: mindy@mindycurnutt.com t: @sqlgirl M O V I N G Y O U F O R W A R D