An introduction to Wait Statistics

Slides:



Advertisements
Similar presentations
DAT 342 Advanced SQL Server Performance and Tuning Bren Newman Program Manager SQL Server Development Microsoft Corporation.
Advertisements

SQL Server Wait Statistics Capture, Report, Analyse Rob Risetto Principal Consultant with StrataDB
5 Common SQL Server Performance Issues Jason Hall-SQL Sentry, Dir of Client Services Blog-jasonhall.blogs.sqlsentry.net.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
Kevin Kline, SQL Sentry Director of Engineering Services, Microsoft SQL Server MVP since 2003 Twitter, Facebook, KEKline.
Chris Testa-O’Neill EMC Consulting. Agenda Resource Governor Integrating Performance Monitor and Profiler Policy Based Management Performance Data Collector.
Module 18 Monitoring SQL Server 2008 R2. Module Overview Monitoring Activity Capturing and Managing Performance Data Analyzing Collected Performance Data.
Connect Learn Share Performance Optimization for Microsoft Dynamics CRM Presented by: Walter Grow Austin Jones.
Key Concepts About Performance Factors Affecting SQL Performance SQL Performance Tuning Methodologies SQL Performance Tuning Tools 1.
Oracle Tuning Considerations. Agenda Why Tune ? Why Tune ? Ways to Improve Performance Ways to Improve Performance Hardware Hardware Software Software.
Learningcomputer.com SQL Server 2008 – Profiling and Monitoring Tools.
Interpreting DMV’s & practical uses Jannie Muller mullerjannie.wordpress.com.
Troubleshooting SQL Server Performance: Tips &Tools Amit Khandelwal.
Connect with life Praveen Srivatsa Founder and CEO – AstraSoft.NET Vinod Kumar Technology Evangelist – Databases and BI.
Diagnosing Performance with Wait Statistics Robert L Davis Principal Database
Troubleshoot Customer Performance Problems Like a Microsoft Engineer Tim Chapman Senior Field Engineer, Microsoft.
Response Time Analysis A Methodology Around SQL Server Wait Types Dean Richards.
SQL Server Deep Dive Denis Reznik Data Architect at Intapp.
Troubleshooting Dennis Shasha and Philippe Bonnet, 2013.
SQL Advanced Monitoring Using DMV, Extended Events and Service Broker Javier Villegas – DBA | MCP | MCTS.
Configuring SQL Server for a successful SharePoint Server Deployment Haaron Gonzalez Solution Architect & Consultant Microsoft MVP SharePoint Server
Using Correlated Tracing to Diagnose Query Level Performance What’s slowing down my app? Jerome Halmans Senior Software Development Engineer Microsoft.
Honest Bob’s Cube Processing Bob Duffy Database Architect.
No more waiting. Sponsors About me  Database Technology Specialist  MVP  Blogger  Author 3
This document is provided for informational purposes only and Microsoft makes no warranties, either express or implied, in this document. Information.
Session Name Pelin ATICI SQL Premier Field Engineer.
Fixing Page Life Expectancy Steve Hood Blog: SimpleSQLServer.com.
SQL Server Internals & Architecture Naomi Williams, SQL DBA LinkedIn
Memory-Optimized Tables Querying at the speed of light.
Top 10 DBA mistakes that affect the SQL Server performance
Curacao SQL Saturday June 11, 2016
Troubleshooting SQL Server high CPU usage
SQL Server Data Collector From Every Angle
Query Performance Tuning: Start to Finish
Hitting the SQL Server “Go Faster” Button
SQL Server Monitoring Overview
Performance Tuning 101: Parallelism
Wait Stats and You.
Software Architecture in Practice
Where to Start, What You Need
Microsoft Dumps Question Answer - Dumps4download
Root Cause Analysis with DMVs
Performance Monitoring Using Extended Events, DMVs & Query Store
Introducing the SQL Server 2016 Query Store
Introducing the SQL Server 2016 Query Store
SQL Server Internals - Performance Troubleshooting Hands on Approach -
Troubleshooting SQL Server Basics
SQLSaturday 393- May 16, Redmond, WA
Hitting the SQL Server “Go Faster” Button
Performance Tuning for Mere Mortals Part II
Proving Hardware Bottlenecks &
Wellington, SQLSaturday#706
Introducing the SQL Server 2016 Query Store
Azure SQL Database - Managing your database on the cloud
Performance Tuning for Mere Mortals Part II
SQL Server Performance Tuning Nowadays
මොඩියුල විශ්ලේෂණය SQL Server Waits. Tables රැසක් එකට එකතු කිරීම.
Targeting Wait Statistics with Extended Events
Troubleshooting Techniques(*)
SQL Server Performance Tuning
Статистика ожиданий или как найти место "где болит"
Analyzing Performance Problems Using XEvents, DMVs & Query Store
Jean Joseph DBA/Developer
Using wait stats to determine why my server is slow
Inside the Database Engine
Developing Microsoft SQL Server Databases
Analyzing Performance Problems Using XEvents, DMVs & Query Store
Inside the Database Engine
Inside the Database Engine
Presentation transcript:

An introduction to Wait Statistics No more waiting An introduction to Wait Statistics SQL Saturday Belgium

A big thank you to our sponsors! SQL Saturday Belgium

About me Chief Consultant DotNine MVP Data Platform Blogger Author Speaker @evdlaar http://www.dotnine.net SQL Saturday Belgium

Agenda What are wait statistics? How wait statistics are generated Querying & analyzing wait statistics Common wait statistics SQL Saturday Belgium

What are wait statistics? SQL Saturday Belgium

What are wait statistics? When SQL Server executes a request but the resources are not available to complete the request a wait occurs SQL Server records the time it has been waiting as wait time and what it has been waiting on as the wait type SQL Saturday Belgium

What are wait statistics? The wait time and wait type are logged at the instance level and are cumulative since last SQL Server start * The wait statistics will show you what your SQL Server instance is spending most of it’s time waiting on! * SQL Server 2016 introduces session based Wait Statistics collection SQL Saturday Belgium

How wait statistics are generated SQL Saturday Belgium

How wait statistics are generated SQL Server uses schedulers to manage CPU time for threads The number of schedulers = number of logical processors + 1 (DAC) View schedulers using sys.dm_os_schedulers SQL Saturday Belgium

How wait statistics are generated Abstract example of a scheduler and its queue states SQL Saturday Belgium

How wait statistics are generated Signal wait time Resource wait time Runnable queue Waiter list SQL Saturday Belgium

How wait statistics are generated Wait time CPU time + Signal wait time + Resource wait time Total execution time SQL Saturday Belgium

Querying & analyzing wait statistics SQL Saturday Belgium

Querying & analyzing wait statistics 2* DMV’s for wait statistics: - sys.dm_os_wait_stats - sys.dm_os_waiting_tasks sys.dm_os_wait_stats cumulative wait times Use sys.dm_os_waiting_tasks to find out what is waiting right now! * SQL Server 2016 introduces session based Wait Statistics collection SQL Saturday Belgium

Querying & analyzing wait statistics Some wait types will log additional information in sys.dm_os_waiting_tasks that will help you troubleshoot! Others you can safely ignore like LAZYWRITER_SLEEP (your mileage may vary) SQL Saturday Belgium

Querying & analyzing wait statistics Sys.dm_os_wait_stats perfect way to capture wait statistics baselines! Without a baseline there is no way of saying a specific wait time is too long! SQL Saturday Belgium

Querying & analyzing wait statistics Wait statistics baseline methodology SQL Saturday Belgium

Querying & analyzing wait statistics Use sys.dm_os_waiting_tasks to find out what is slowing you down right now Compare the wait times to your baseline Focus on large increases or decreases for the top n wait types Don’t freak out! SQL Saturday Belgium

Common wait statistics SQL Saturday Belgium

Common wait statistics CXPACKET LCK_M_xx PAGEIOLATCH_xx OLEDB THREADPOOL SQL Saturday Belgium

Common wait statistics CXPACKET CXPACKET waits always occur when you use parallelism (MDOP) Investigate execution plans, tune MDOP cost threshold, check statistics Don’t freak out and turn of parallelism! SQL Saturday Belgium

Common wait statistics LCK_M_xx LCK_M_xx waits occur when blocking is occuring Check if there is a blocking bottleneck, break up large updates, change isolation level SQL Saturday Belgium

Common wait statistics PAGEIOLATCH_xx Latches are synchronization objects for buffer pages PAGEIOLATCH_xx occurs when data is moved from disk to the buffer cache Can indicate IO subsystem or memory issues, check indexes, statistics SQL Saturday Belgium

Common wait statistics OLEDB OLEDB occurs when SQL Server calls the Microsoft SQL Native Client OLE DB provider Will also occur when you are using linked servers DBCC commands will also generate OLEDB waits! SQL Saturday Belgium

Common wait statistics THREADP L THREADPOOL waits occur when there are no free worker threads available Max nr. of worker threads (64bit): <= 4 CPU’s = 512 > 4 CPU’s = 512 + ((CPU’s – 4) * 16) SQL Saturday Belgium

Common wait statistics THREADP L Can be caused by blocking, large query batches, increased number of user connections or large number of concurrent parallel plans Check causes above before changing max worker threads!!! SQL Saturday Belgium

Questions? SQL Saturday Belgium

Additional reading SQL Server 2005 Waits and Queues Tom Davidson - http://bit.ly/1o2NFoF Paul Randal SQLskills.com blog http://bit.ly/1Dj4yoR Microsoft MSDN sys.dm_os_wait_stats http://bit.ly/1le9dx0 SQL Saturday Belgium

A big thank you to our sponsors! SQL Saturday Belgium