Waits and Queues and You. Thomas LaRock Senior DBA, Confio Software



Similar documents
PERFORMANCE TUNING WITH WAIT STATISTICS. Microsoft Corporation Presented by Joe Sack, Dedicated Support Engineer

SQL Server Performance Tuning Using Wait Statistics: A Beginner s Guide. By Jonathan Kehayias and Erin Stellato

The 5-minute SQL Server Health Check

SQL Server Performance Intelligence

SQLintersection SQL123

PERFORMANCE TUNING IN MICROSOFT SQL SERVER DBMS

Solving Performance Problems In SQL Server by Michal Tinthofer

SQL Server Performance Tuning and Optimization

Microsoft SQL Server: MS Performance Tuning and Optimization Digital

Performance Tuning and Optimizing SQL Databases 2016

Response Time Analysis

SQL Server 2012 Optimization, Performance Tuning and Troubleshooting

Everything a DBA Needs to Know About Storage

Resource Governor, Monitoring and Tracing. On SQL Server

Using Database Performance Warehouse to Monitor Microsoft SQL Server Report Content

Boost SQL Server Performance Buffer Pool Extensions & Delayed Durability

Optimising SQL Server CPU performance

Performance Monitoring with Dynamic Management Views

Data Warehouse in the Cloud Marketing or Reality? Alexei Khalyako Sr. Program Manager Windows Azure Customer Advisory Team

Response Time Analysis

ONSITE TRAINING CATALOG

Guerrilla Warfare? Guerrilla Tactics - Performance Testing MS SQL Server Applications

SQL QUERY TUNING FOR SQL SERVER. Getting It Right the First Time

Performance Monitoring AlwaysOn Availability Groups. Anthony E. Nocentino

Response Time Analysis

W I S E. SQL Server 2008/2008 R2 Advanced DBA Performance & WISE LTD.

Waiting and Blocking Issues

RESOURCE GOVERNOR IN SQL SERVER 2008

Throwing Hardware at SQL Server Performance problems?

High Performance SQL Server Performance Tuning with SQL Server Dynamic Management Views

Professional SQL Server 2012 Internals and Troubleshooting

Database Monitoring and Performance Tuning

High Performance SQL Server Performance Tuning with SQL Server Dynamic Management Views

Troubleshooting SQL Server A Guide for the Accidental DBA

SQL Server 2014 Performance Tuning and Optimization 55144; 5 Days; Instructor-led

Server 2008 SQL. Administration in Action ROD COLLEDGE MANNING. Greenwich. (74 w. long.)

Diagnosing and Resolving Latch Contention on SQL Server

About Me: Brent Ozar. Perfmon and Profiler 101

Enhancing SQL Server Performance

Administering Microsoft SQL Server 2012 Databases

SQL Server Transaction Log from A to Z

Predicting Change Outcomes Leveraging SQL Server Profiler

Advanced Performance Forensics

EMC Unisphere for VMAX Database Storage Analyzer

SQL Server PDW. Artur Vieira Premier Field Engineer

Load Testing Analysis Services Gerhard Brückl

Red Gate Books SQL Server DMV Starter Pack

Best Practices for Optimizing SQL Server Database Performance with the LSI WarpDrive Acceleration Card

Query Performance Tuning: Start to Finish. Grant Fritchey

Extending Your Use of Extended Events

Predefined Analyser Rules for MS SQL Server

"Charting the Course... MOC AC SQL Server 2014 Performance Tuning and Optimization. Course Summary

Performance Counters. Microsoft SQL. Technical Data Sheet. Overview:

SQL Server Performance Tuning for DBAs

Chapter 15: AppInsight for SQL

MS SQL Performance (Tuning) Best Practices:

Databases Going Virtual? Identifying the Best Database Servers for Virtualization

A Comparison of Oracle Performance on Physical and VMware Servers

Course 55144: SQL Server 2014 Performance Tuning and Optimization

A Walk Around the SQL Server 2012 Audit Feature. Timothy P. McAliley Microsoft Premier Field Engineer SQL Server

Best Practices for Monitoring Databases on VMware. Dean Richards Senior DBA, Confio Software

SQL Server 2016 New Features!

WAIT-TIME ANALYSIS METHOD: NEW BEST PRACTICE FOR APPLICATION PERFORMANCE MANAGEMENT

Oracle RAC Tuning Tips

AE EHR Database Servers

SolarWinds Database Performance Analyzer (DPA) or OEM?

SQL Server Storage: The Terabyte Level. Brent Ozar, Microsoft Certified Master, MVP Consultant & Trainer, SQLskills.com

The Complete Performance Solution for Microsoft SQL Server

ESSENTIAL PERFORMANCE TOOLS FOR SQL SERVER DBAS

Microsoft SQL Server OLTP Best Practice

Gavin Payne Senior Consultant.

Wait-Time Analysis Method: New Best Practice for Performance Management

SSMS Built in Reports for Server and Database Monitoring

A Comparison of Oracle Performance on Physical and VMware Servers

How Digital Outsource Services DBA team catch deployment problems

EZManage V4.0 Release Notes. Document revision 1.08 ( )

Perfmon counters for Enterprise MOSS

SQL Server 2014 New Features/In- Memory Store. Juergen Thomas Microsoft Corporation

Troubleshooting SQL Server Enterprise Geodatabase Performance Issues. Matthew Ziebarth and Ben Lin

Proactive database performance management

Transaction Performance Maximizer InterMax

Sitecore Health. Christopher Wojciech. netzkern AG. Sitecore User Group Conference 2015

Would-be system and database administrators. PREREQUISITES: At least 6 months experience with a Windows operating system.

Module 3: Instance Architecture Part 1

SAP HANA - Main Memory Technology: A Challenge for Development of Business Applications. Jürgen Primsch, SAP AG July 2011

SQL Server Query Tuning

IBM Systems and Technology Group May 2013 Thought Leadership White Paper. Faster Oracle performance with IBM FlashSystem

LEVERAGE YOUR INVESTMENT IN DATABASE PERFORMANCE ANALYZER (CONFIO IGNITE) OCT 2015

A Performance Engineering Story

Using Management Data Warehouse for Performance Monitoring

Troubleshooting Performance Problems in SQL

Microsoft SQL Server performance tuning for Microsoft Dynamics NAV

Course Outline. SQL Server 2014 Performance Tuning and Optimization Course 55144: 5 days Instructor Led

Informix Performance Tuning using: SQLTrace, Remote DBA Monitoring and Yellowfin BI by Lester Knutsen and Mike Walker! Webcast on July 2, 2013!

Business Application Services Testing

Understand Performance Monitoring

Course 55144B: SQL Server 2014 Performance Tuning and Optimization

TRACE PERFORMANCE TESTING APPROACH. Overview. Approach. Flow. Attributes

OpenAdmin Tool for Informix (OAT) October 2012

MS SQL Server 2014 New Features and Database Administration

Transcription:

Waits and Queues and You Thomas LaRock Senior DBA, Confio Software 1

Who Am I? @SQLRockstar http://thomaslarock.com

3 Learning to Drive

4 Learning to DBA

5 Car Engine

SQL Server is a Black Box INPUT OUTPUT 6

7 SQLOS

8

9 SQLOS

Agenda Describe Execution Model 10

Agenda Describe Execution Model Use some DMVs 11

Agenda Describe Execution Model Use some DMVs Show why we measure waits (use case) 12

13 Execution Model Example

14 Your Tax Dollars at Work

15 Your Tax Dollars at Work

16

17

18

19

Execution Model (TSA) Passport checked Assigned a lane Put stuff on belt Freedom Pat Head to gate 20

Execution Model (SQLOS) Init Runnable Waiting Running Done 21

Execution Model (SQLOS) CPU 1 SPID 77 Running CPU 1 Queue Waiter Queue SPID 62 ASYNC_NETWORK_IO SPID 63 CXPACKET SPID 67 PAGEIOLATCH_SH SPID 74 LCK_M_S SPID 79 LATCH_EX SPID 87 WRITELOG SPID 81 Runnable SPID 91 Runnable 22

Execution Model (SQLOS) CPU 1 SPID 77 Running CPU 1 Queue Waiter Queue SPID 62 ASYNC_NETWORK_IO SPID 63 CXPACKET SPID 67 PAGEIOLATCH_SH SPID 74 LCK_M_S SPID 79 LATCH_EX SPID 87 WRITELOG SPID 81 Runnable SPID 91 Runnable SPID 67 Runnable 23

Execution Model (SQLOS) CPU 1 SPID 77 Running CPU 1 Queue Waiter Queue SPID 62 ASYNC_NETWORK_IO SPID 63 CXPACKET SPID 67 PAGEIOLATCH_SH SPID 74 LCK_M_S SPID 77 LCK_M_IX SPID 79 LATCH_EX SPID 87 WRITELOG SPID 81 Runnable SPID 91 Runnable SPID 67 Runnable 24

Execution Model (SQLOS) CPU 1 SPID 81 Running CPU 1 Queue Waiter Queue SPID 62 ASYNC_NETWORK_IO SPID 63 CXPACKET SPID 67 PAGEIOLATCH_SH SPID 74 LCK_M_S SPID 79 LATCH_EX SPID 87 WRITELOG SPID 77 LCK_M_IX SPID 81 Runnable SPID 91 Runnable SPID 67 Runnable 25

Execution Model (SQLOS) CPU 1 SPID 77 Running CPU 1 Queue Waiter Queue SPID 62 ASYNC_NETWORK_IO SPID 63 CXPACKET SPID 67 PAGEIOLATCH_SH SPID 74 LCK_M_S SPID 79 LATCH_EX SPID 87 WRITELOG SPID 81 Runnable SPID 91 Runnable 26

Execution Model (SQLOS) CPU 1 SPID 77 Running CPU 1 Queue Waiter Queue SPID 62 ASYNC_NETWORK_IO SPID 63 CXPACKET SPID 67 PAGEIOLATCH_SH SPID 74 LCK_M_S SPID 79 LATCH_EX SPID 87 WRITELOG SPID 81 Runnable SPID 91 Runnable 27

Execution Model (SQLOS) CPU 1 SPID 77 Running CPU 1 Queue Waiter Queue SPID 62 ASYNC_NETWORK_IO SPID 63 CXPACKET SPID 67 PAGEIOLATCH_SH SPID 74 LCK_M_S SPID 79 LATCH_EX SPID 87 WRITELOG SPID 81 Runnable SPID 91 Runnable 28

Execution Model (DMVs) Init Runnable Waiting Running Done 29

Execution Model (DMVs) sys.dm_exec_sessions sys.dm_exec_requests = runnable sys.dm_os_waiting_tasks sys.dm_exec_requests = running sys.dm_exec_connections 30

Demo DEMO 31

Sample Wait Types 1. 2. 3. 4. 5. 32

Sample Wait Types 1. 2. 3. 4. 5. LCK_M_S, LCK_M_U, LCK_M_X 33

Sample Wait Types 1. 2. 3. 4. 5. LCK_M_S, LCK_M_U, LCK_M_X Waiting to acquire locks 34

Sample Wait Types 1. 2. 3. 4. PAGEIOLATCH_SH, PAGEIOLATCH_EX 5. LCK_M_S, LCK_M_U, LCK_M_X Waiting to acquire locks 35

Sample Wait Types 1. 2. 3. 4. PAGEIOLATCH_SH, PAGEIOLATCH_EX Physical disk reads 5. LCK_M_S, LCK_M_U, LCK_M_X Waiting to acquire locks 36

Sample Wait Types 1. 2. 3. WRITELOG 4. PAGEIOLATCH_SH, PAGEIOLATCH_EX Physical disk reads 5. LCK_M_S, LCK_M_U, LCK_M_X Waiting to acquire locks 37

Sample Wait Types 1. 2. 3. WRITELOG Waiting for a log flush to complete 4. PAGEIOLATCH_SH, PAGEIOLATCH_EX Physical disk reads 5. LCK_M_S, LCK_M_U, LCK_M_X Waiting to acquire locks 38

Sample Wait Types 1. 2. CXPACKET 3. WRITELOG Waiting for a log flush to complete 4. PAGEIOLATCH_SH, PAGEIOLATCH_EX Physical disk reads 5. LCK_M_S, LCK_M_U, LCK_M_X Waiting to acquire locks 39

Sample Wait Types 1. 2. CXPACKET Parallelism 3. WRITELOG Waiting for a log flush to complete 4. PAGEIOLATCH_SH, PAGEIOLATCH_EX Physical disk reads 5. LCK_M_S, LCK_M_U, LCK_M_X Waiting to acquire locks 40

Sample Wait Types 1. ASYNC_NETWORK_IO, NETWORKIO 2. CXPACKET Parallelism 3. WRITELOG Waiting for a log flush to complete 4. PAGEIOLATCH_SH, PAGEIOLATCH_EX Physical disk reads 5. LCK_M_S, LCK_M_U, LCK_M_X Waiting to acquire locks 41

Sample Wait Types 1. ASYNC_NETWORK_IO, NETWORKIO Waiting on the network 2. CXPACKET Parallelism 3. WRITELOG Waiting for a log flush to complete 4. PAGEIOLATCH_SH, PAGEIOLATCH_EX Physical disk reads 5. LCK_M_S, LCK_M_U, LCK_M_X Waiting to acquire locks 42

Why Measure Waits? Think about how you currently resolve performance issues, does it look like this? 43

Why Measure Waits? Think about how you currently resolve performance issues, does it look like this? 44

Why Wait Time Analysis Rocks Allows you to focus on *the* problem Four possible resource bottlenecks 45

Why Wait Time Analysis Rocks Allows you to focus on *the* problem Four possible resource bottlenecks Waits help you to answer the BIG question: Is this a problem? 46

Why Wait Time Analysis Rocks Allows you to focus on *the* problem Four possible resource bottlenecks Waits help you to answer the BIG question: Is this a problem? Helps to prioritize Fix the ones you can fix now 47

Why Wait Time Analysis Rocks Allows you to focus on *the* problem Four possible resource bottlenecks Waits help you to answer the BIG question: Is this a problem? Helps to prioritize Fix the ones you can fix now Does not rely on Health Stats alone Perfmon counters only? 48

49 Use Case (or, My Story)

How To Measure? 3 rd party tools Native tools DMVs Perfmon xevents MDW/UCP 50

Know What You Are Measuring Know difference between wait and queue Wait Any time a session is waiting Queue A measure of system resource and utilization (think perfmon) 51

Know What You Are Measuring Know difference between wait and queue Wait Any time a session is waiting Queue A measure of system resource and utilization (think perfmon) Difference between OLTP and OLAP Which one has more ad-hoc queries? Which one is more likely to see parallelism? Which one is likely to see more blocking/locking? 52

Know What You Are Measuring Know difference between wait and queue Wait Any time a session is waiting Queue A measure of system resource and utilization (think perfmon) Difference between OLTP and OLAP Which one has more ad-hoc queries? Which one is more likely to see parallelism? Which one is likely to see more blocking/locking? What does all that mean to the DBA? 53

54 Operating With Precision

For More Information http://sqlcat.com/whitepapers/archive/2007/1 1/19/sql-server-2005-waits-and-queues.aspx http://technet.microsoft.com/enus/sqlserver/gg508897.aspx 55

For More Information http://sqlskills.com/blogs/paul/post/waitstatistics-or-please-tell-me-where-it-hurts.aspx https://sqlserverperformance.wordpress.com/ http://thomaslarock.com/presentations http://speakerrate.com/speakers/3000- sqlrockstar 56

Thanks! THANK YOU DALLAS! NEXT STOP: LOUISVILLE! 57

58 Questions?