SQLSaturday 393- May 16, Redmond, WA

Slides:



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

#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.
SQL SERVER DAYS 2011 Optimizing SQL Server Performance in a Virtual Environment Denny Cherry twitter.com/mrdenny.
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.
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
Diagnosing Performance with Wait Statistics Robert L Davis Principal Database
Strategies for Working with Texas-sized Databases Robert L Davis Database Engineer
C:\Users\> t An affair with SQL Server for nearly a decade Was part of SQL Escalation Services and Premier Field Engineering team.
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
Monitoring SQL with System Center
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
Building a Performance Monitoring System using XEvents and DMVs
SQL Server Monitoring Overview
Exploiting SQL Server Security Holes
Summit Nashville /28/2018 8:42 PM
Performance Tuning 101: Parallelism
Where to Start, What You Need
Inside SQL Server Wait Types
Optimizing SQL Server Performance in a Virtual Environment
Troubleshooting SQL Server Connection Issues
SQL Server Security Mistakes Everyone Makes
Root Cause Analysis with DMVs
Performance Monitoring Using Extended Events, DMVs & Query Store
Troubleshooting Service Broker
How to Lose Your Job in 3 Easy Steps
SQL Server Internals - Performance Troubleshooting Hands on Approach -
Troubleshooting SQL Server Basics
Performance Tuning for Mere Mortals Part II
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
SQL Server Performance Tuning Nowadays
SQLCmd Mode The T-SQL Easy Button
SQL Server Mythconceptions And Mythteries
Hidden Gems of SQL Server 2016
මොඩියුල විශ්ලේෂණය SQL Server Waits. Tables රැසක් එකට එකතු කිරීම.
Dynamic Management Views a practical overview!
SQL Server Performance Tuning
It’s TEMPDB Why Should You Care?
Статистика ожиданий или как найти место "где болит"
Dynamic Management Views a practical overview!
Analyzing Performance Problems Using XEvents, DMVs & Query Store
Jean Joseph DBA/Developer
Denis Reznik SQL Server 2017 Hidden Gems.
Using wait stats to determine why my server is slow
Inside the Database Engine
Developing Microsoft SQL Server Databases
Advanced Database Topics
Analyzing Performance Problems Using XEvents, DMVs & Query Store
Inside the Database Engine
Denis Reznik SQL Server 2017 Hidden Gems.
Inside the Database Engine
The DBA Quit and now you’re it:
Presentation transcript:

SQLSaturday 393- May 16, 2015- Redmond, WA Diagnosing Performance with Wait Statistics SQLSaturday 393- May 16, 2015- Redmond, WA Principal Database Architect at DB Best Technologies www.dbbest.com Former Principal DBA at Outerwall, Inc Former Sr. Product Consultant with Idera Software Former Program Manager for SQL Server Certified Master program in Microsoft Learning Former Sr. Production DBA / Operations Engineer at Microsoft (CSS) Microsoft Certified Master: SQL Server 2008 / MCSM Charter: Data Platform Co-founder of the SQL PASS Security Virtual Chapter MCITP: Database Developer: SQL Server 2005 and 2008 MCITP: Database Administrator: SQL Server 2005 and 2008 MCSE: Data Platform MVP 2014 Co-author of Pro SQL Server 2008 Mirroring Former Idera ACE (Advisors & Community Educators) 2 time host of T-SQL Tuesday Guest Professor at SQL University, summer 2010, spring/summer 2011 Speaker at SQL PASS Summit 2010, 2011, and 2012 including a pre-con in 2012 Speaker/Pre-con at SQLRally 2012 13+ years working with SQL Server Writer for SQL Server Pro (formerly SQL Server Magazine) Member: Mensa Dog picture: Maggie and Woody SQLCruise instructor: Seattle to Alaska 2012 Speaker at SQL Server Intelligence Conference in Seattle 2012 Blog: http://www.sqlsoldier.com Twitter: http://twitter.com/SQLSoldier Robert L Davis Principal Database Architect robertd@dbbest.com @SQLSoldier www.dbbest.com

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 www.SQLSoldier.com @SQLSoldier www.linkedin.com/in/robertldavis Principal Database Architect at DB Best Technologies www.dbbest.com Former Principal DBA at Outerwall, Inc Former Sr. Product Consultant with Idera Software Former Program Manager for SQL Server Certified Master program in Microsoft Learning Former Sr. Production DBA / Operations Engineer at Microsoft (CSS) Microsoft Certified Master: SQL Server 2008 / MCSM Charter: Data Platform Co-founder of the SQL PASS Security Virtual Chapter MCITP: Database Developer: SQL Server 2005 and 2008 MCITP: Database Administrator: SQL Server 2005 and 2008 MCSE: Data Platform MVP 2014 Co-author of Pro SQL Server 2008 Mirroring Former Idera ACE (Advisors & Community Educators) 2 time host of T-SQL Tuesday Guest Professor at SQL University, summer 2010, spring/summer 2011 Speaker at SQL PASS Summit 2010, 2011, and 2012 including a pre-con in 2012 Speaker/Pre-con at SQLRally 2012 13+ years working with SQL Server Writer for SQL Server Pro (formerly SQL Server Magazine) Member: Mensa Dog picture: Maggie and Woody SQLCruise instructor: Seattle to Alaska 2012 Speaker at SQL Server Intelligence Conference in Seattle 2012 Blog: http://www.sqlsoldier.com Twitter: http://twitter.com/SQLSoldier

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: http://bit.ly/LsoN5x

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 Resources http://www.sqlsoldier.com/wp/tag/performance-optimization http://www.sqlsoldier.com/wp/tag/troubleshooting http://sqlserverperformance.wordpress.com/?s=DMV http://sqlloadgenerator.codeplex.com

Diagnosing Performance with Wait Statistics Q & A

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