Diagnosing Performance with Wait Statistics Robert L Davis Principal Database

Slides:



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

Advanced Tuning: Unconventional Solutions to Everyday Problems Robert L Davis.
#RefreshCache Database Performance Tuning October 9-11, 2011 Tom Powers IT Applications Team Manager Southeast Christian Church Louisville, KY
SQL Server Wait Statistics Capture, Report, Analyse Rob Risetto Principal Consultant with StrataDB
Gather SQL Server Performance Data with PowerShell
Case Study: Designing a Global Scaled-out Architecture Robert L Davis
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
Module 18 Monitoring SQL Server 2008 R2. Module Overview Monitoring Activity Capturing and Managing Performance Data Analyzing Collected Performance Data.
Key Concepts About Performance Factors Affecting SQL Performance SQL Performance Tuning Methodologies SQL Performance Tuning Tools 1.
DMV Performance Monitoring & Tuning Presented by Franklin Yamamoto.
Administration and Monitoring the Database Oracle 10g.
Agenda for Today Do Chapter 14 Final Project Review for Final.
Learningcomputer.com SQL Server 2008 – Profiling and Monitoring Tools.
© 2008 Quest Software, Inc. ALL RIGHTS RESERVED. Perfmon and Profiler 101.
SQLRX – SQL Server Administration – Tips From the Trenches SQL Server Administration – Tips From the Trenches Troubleshooting Reports of Sudden Slowdowns.
Interpreting DMV’s & practical uses Jannie Muller mullerjannie.wordpress.com.
ObjectCounterLook For Processor% Processor Time
Licensing SQL Server on a Virtual Platform Robert L Davis
Troubleshoot Customer Performance Problems Like a Microsoft Engineer Tim Chapman Senior Field Engineer, Microsoft.
Advanced Performance Tuning Tips with Database Performance Analyzer Jon Shaulis Senior DBA © 2014 SOLARWINDS WORLDWIDE, LLC. ALL RIGHTS RESERVED.
Kevin Kline Technical Evangelist, SQL Sentry SQL Server MVP since 2003 Twitter, FB, LI, KEKline Blog:
10 SQL Server Wait Types Everyone Should Know
C:\Users\> t An affair with SQL Server for nearly a decade Was part of SQL Escalation Services and Premier Field Engineering team.
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.
No more waiting. Sponsors About me  Database Technology Specialist  MVP  Blogger  Author 3
10 Things All BI Administrators Should Know Robert L Davis Database Engineer
SQL Server Internals & Architecture Naomi Williams, SQL DBA LinkedIn
An introduction to Wait Statistics
What Is a Latch? …and Why Do I Care? Eddie Wuerch, mcm
Troubleshooting SQL Server high CPU usage
What Is a Latch? …and Why Do I Care? Eddie Wuerch, mcm
Query Performance Tuning: Start to Finish
Tuna Helper Proven Process for SQL Tuning Janis Griffin Senior DBA, Confio Software 1.
Building a Performance Monitoring System using XEvents and DMVs
SQL Server Monitoring Overview
Performance Tuning 101: Parallelism
Wait Stats and You.
Where to Start, What You Need
Inside SQL Server Wait Types
Root Cause Analysis with DMVs
Performance Monitoring Using Extended Events, DMVs & Query Store
SQL Server Internals - Performance Troubleshooting Hands on Approach -
Troubleshooting SQL Server Basics
SQLSaturday 393- May 16, Redmond, WA
Performance Tuning for Mere Mortals Part II
Proving Hardware Bottlenecks &
What Is a Latch? …and Why Do I Care? Eddie Wuerch, mcm
SQL Server Mythconceptions And Mythteries
Performance Tuning for Mere Mortals Part II
Securing SQL Server Processes with Certificates
New Paradigm for Performance Tuning in SQL Server 2016
SQLCmd Mode The T-SQL Easy Button
SQL Server Mythconceptions And Mythteries
මොඩියුල විශ්ලේෂණය SQL Server Waits. Tables රැසක් එකට එකතු කිරීම.
Dynamic Management Views a practical overview!
SQL Server Performance Tuning
It’s TEMPDB Why Should You Care?
Статистика ожиданий или как найти место "где болит"
Kris Hokanson That’s bad mmmkay! …Or, how to know when your SQL Server isn’t working as well as it could.
Dynamic Management Views a practical overview!
Analyzing Performance Problems Using XEvents, DMVs & Query Store
Jean Joseph DBA/Developer
Building a Performance Monitoring System using XEvents and DMVs
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:

Diagnosing Performance with Wait Statistics Robert L Davis Principal Database

Robert L Davis Principal Database Architect at DB Best Technologies Greater Seattle Area | Information Technology and Services Past: Blog: Twitter: LinkedIN: Principal DBA at Outerwall, Inc. P.M. SQL Server Master Certification Program at Microsoft Sr. Database Administrator at Microsoft

Diagnosing Performance with Wait Statistics “Find the problem, FIX IT. Identify another problem, FIX IT. Repeat as necessary.” ~ Keenan Thompson (Saturday Night Live)

Diagnosing Performance with Wait Statistics  Medical approach to troubleshooting

Diagnosing Performance with Wait Statistics  Medical approach to troubleshooting  Baseline vital statistics  Performance counters  DMV stats

Diagnosing Performance with Wait Statistics  Medical approach to troubleshooting  Baseline vital statistics  Performance counters  DMV stats  Recheck vital statistics and compare

Diagnosing Performance with Wait Statistics  Medical approach to troubleshooting  Baseline vital statistics  Performance counters  DMV stats  Recheck vital statistics and compare  Find deviations from the norm

Diagnosing Performance with Wait Statistics  Medical approach to troubleshooting  Baseline vital statistics  Performance counters  DMV stats  Recheck vital statistics and compare  Find deviations from the norm  Read more:

Diagnosing Performance with Wait Statistics  Baseline for Performance

Diagnosing Performance with Wait Statistics  Baseline for Performance  Processor(*)\% Processor Time  PhysicalDisk\Avg. Disk sec/Read  PhysicalDisk\Avg. Disk sec/Write  Memory\Pages/sec  Memory\Available Bytes  SQLServer:Buffer Manager\Page life expectancy  SQLServer:GeneralStatistics\Processes Blocked  SQLServer:Access Methods\Full Scans/sec  SQLServer:SQL Statistics\Batch requests/sec  SQLServer:Buffer Manager\Lazy writes/sec  SQLServer:Buffer Manager\Buffer Cache Hit Ratio  SQLServer:Databases (*)\Transactions/sec

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  Wait statistics

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  Wait statistics  sys.dm_os_wait_stats  sys.dm_os_waiting_tasks  sys.dm_exec_requests  sys.dm_exec_sessions  sys.dm_exec_query_plan()  sys.dm_exec_sql_text()

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  sys.dm_os_wait_stats

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  sys.dm_os_wait_stats  Cumulative since last restart or reset

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  sys.dm_os_wait_stats  Cumulative since last restart or reset  DBCC SQLPERF ('sys.dm_os_wait_stats', CLEAR);

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  sys.dm_os_wait_stats  Cumulative since last restart or reset  DBCC SQLPERF ('sys.dm_os_wait_stats', CLEAR);  Total waits on server

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  sys.dm_os_wait_stats  Cumulative since last restart or reset  DBCC SQLPERF ('sys.dm_os_wait_stats', CLEAR);  Total waits on server  Take a delta to see how they are changing

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  sys.dm_os_wait_stats  Cumulative since last restart or reset  DBCC SQLPERF ('sys.dm_os_wait_stats', CLEAR);  Total waits on server  Take a delta to see how they are changing  signal_wait_time_ms  Time from when the waiting task has its resource until it starts running  Waiting on CPU thread

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  sys.dm_os_waiting_tasks

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  sys.dm_os_waiting_tasks  Tasks currently waiting on a resource

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  sys.dm_os_waiting_tasks  Tasks currently waiting on a resource  wait_duration_ms

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  sys.dm_os_waiting_tasks  Tasks currently waiting on a resource  wait_duration_ms  wait_type

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  sys.dm_os_waiting_tasks  Tasks currently waiting on a resource  wait_duration_ms  wait_type  blocking_session_id

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  sys.dm_os_waiting_tasks  Tasks currently waiting on a resource  wait_duration_ms  wait_type  blocking_session_id  resource_description

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  sys.dm_exec_requests

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  sys.dm_exec_requests  Currently active requests  Shows wait stats too!  session_id  request_id – for parallel tasks  start_time  status – suspended = waiting  command  database_id  blocking_session_id  wait_type  wait_time  last_wait_type – if not currently waiting  wait_resource

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  sys.dm_exec_sessions

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  sys.dm_exec_sessions  Currently active sessions  Shows client connection info  Not all sessions have a request  Has some performance stats cumulative over all requests for the entire session  program_name  is_user_process

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  sys.dm_exec_query_plan()  Query plan from cache  Requires plan_handle

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries  sys.dm_exec_query_plan()  Query plan from cache  Requires plan_handle  sys.dm_exec_sql_text()  SQL text from cache  Requires sql_handle or plan_handle  Provides offset values to identify the currently executing statement in a batch

Diagnosing Performance with Wait Statistics  SOS_SCHEDULER_YIELD

Diagnosing Performance with Wait Statistics  SOS_SCHEDULER_YIELD  SOS: SQLOS

Diagnosing Performance with Wait Statistics  SOS_SCHEDULER_YIELD  SOS: SQLOS  SCHEDULER: manages worker threads onto CPU threads

Diagnosing Performance with Wait Statistics  SOS_SCHEDULER_YIELD  SOS: SQLOS  SCHEDULER: manages worker threads onto CPU threads  YIELD: Giving way to another

Diagnosing Performance with Wait Statistics  SOS_SCHEDULER_YIELD  SOS: SQLOS  SCHEDULER: manages worker threads onto CPU threads  YIELD: Giving way to another  Waiting for another worker thread to yield the CPU thread

Diagnosing Performance with Wait Statistics  PAGE_LATCH / PAGE_IO_LATCH

Diagnosing Performance with Wait Statistics  PAGE_LATCH / PAGE_IO_LATCH  PAGE: unit of data storage in SQL Server

Diagnosing Performance with Wait Statistics  PAGE_LATCH / PAGE_IO_LATCH  PAGE: unit of data storage in SQL Server  IO: reading (I) and writing (O), in this case disk IO

Diagnosing Performance with Wait Statistics  PAGE_LATCH / PAGE_IO_LATCH  PAGE: unit of data storage in SQL Server  IO: reading (I) and writing (O), in this case disk IO  LATCH: Lightweight locking mechanism

Diagnosing Performance with Wait Statistics  PAGE_LATCH / PAGE_IO_LATCH  PAGE: unit of data storage in SQL Server  IO: reading (I) and writing (O), in this case disk IO  LATCH: Lightweight locking mechanism  Waiting for a latch on a page in memory or a page on disk

Diagnosing Performance with Wait Statistics  CXPACKET

Diagnosing Performance with Wait Statistics  CXPACKET  CX: Communication eXchange

Diagnosing Performance with Wait Statistics  CXPACKET  CX: Communication eXchange  PACKET: unit of communication

Diagnosing Performance with Wait Statistics  CXPACKET  CX: Communication eXchange  PACKET: unit of communication  Parallelism is occurring

Diagnosing Performance with Wait Statistics  NETWORK_IO

Diagnosing Performance with Wait Statistics  NETWORK_IO  NETWORK: External communication

Diagnosing Performance with Wait Statistics  NETWORK_IO  NETWORK: External communication  IO: Reading (I) and writing (O)

Diagnosing Performance with Wait Statistics  NETWORK_IO  NETWORK: External communication  IO: Reading (I) and writing (O)  SQL is writing faster than the client is reading

Diagnosing Performance with Wait Statistics  PREEMPTIVE_OS_xxxxx

Diagnosing Performance with Wait Statistics  PREEMPTIVE_OS_xxxxx  PREEMPTIVE: Non-yielding

Diagnosing Performance with Wait Statistics  PREEMPTIVE_OS_xxxxx  PREEMPTIVE: Non-yielding  OS: Operating System

Diagnosing Performance with Wait Statistics  PREEMPTIVE_OS_xxxxx  PREEMPTIVE: Non-yielding  OS: Operating System  xxxxx: The OS operation or API being called  Non-yielding shell out to the Operating System

Diagnosing Performance with Wait Statistics  PREEMPTIVE_OS_AUTHENTICATIONOPS

Diagnosing Performance with Wait Statistics  PREEMPTIVE_OS_AUTHENTICATIONOPS  PREEMPTIVE: Non-yielding  OS: Operating System

Diagnosing Performance with Wait Statistics  PREEMPTIVE_OS_AUTHENTICATIONOPS  PREEMPTIVE: Non-yielding  OS: Operating System  AUTHENTICATIONOPS: The OS operation or API being called

Diagnosing Performance with Wait Statistics  PREEMPTIVE_OS_AUTHENTICATIONOPS  PREEMPTIVE: Non-yielding  OS: Operating System  AUTHENTICATIONOPS: The OS operation or API being called, a group of API calls related to authentication

Diagnosing Performance with Wait Statistics  PREEMPTIVE_OS_AUTHENTICATIONOPS  PREEMPTIVE: Non-yielding  OS: Operating System  AUTHENTICATIONOPS: The OS operation or API being called, a group of API calls related to authentication  Non-yielding shell out to the OS to perform authentication operations

Diagnosing Performance with Wait Statistics  PREEMPTIVE_OS_VERIFYSIGNATURE

Diagnosing Performance with Wait Statistics  PREEMPTIVE_OS_VERIFYSIGNATURE  PREEMPTIVE: Non-yielding  OS: Operating System  VERIFYSIGNATURE: The OS operation or API being called

Diagnosing Performance with Wait Statistics  PREEMPTIVE_OS_VERIFYSIGNATURE  PREEMPTIVE: Non-yielding  OS: Operating System  VERIFYSIGNATURE: The OS operation or API being called  Let’s Look it Up

Diagnosing Performance with Wait Statistics  PREEMPTIVE_OS_VERIFYSIGNATURE  PREEMPTIVE: Non-yielding  OS: Operating System  VERIFYSIGNATURE: The OS operation or API being called  Verifies if a digital signature matches the signature used to encrypt data

Diagnosing Performance with Wait Statistics  PREEMPTIVE_OS_VERIFYSIGNATURE  PREEMPTIVE: Non-yielding  OS: Operating System  VERIFYSIGNATURE: The OS operation or API being called  Let’s Look it Up

Diagnosing Performance with Wait Statistics  Troubleshooting Slow Queries

Diagnosing Performance with Wait Statistics  Resources  optimization optimization   

Diagnosing Performance with Wait Statistics

Thanks! Thank you for coming!  My blog:  Twitter: twitter.com/SQLSoldiertwitter.com/SQLSoldier  Engage me on your project: