SlideShare a Scribd company logo
The Importance of Wait Statistics
in Monitoring SQL Server
Grant Fritchey
Get in touch
scarydba.com
grant@scarydba.com
@gfritchey
Grant Fritchey
What is a Wait?
• SQL Server does work
• All the work doesn’t occur simultaneously
• When a unit of work stops
• Threads
– RUNNING
– SUSPENDED
– RUNNABLE
• Time spent between RUNNING and RUNNING
Why Are Waits Important?
• Why is the server slow
• Where is the server slow
• Which resources are waiting frequently
• Which resources are waiting long
• Direct pointer to the cause of poor performance
Where Do I Get Waits
• Sys.dm_os_wait_stats
• Sys.dm_db_wait_stats
• sys.dm_os_latch_stats
Are Some Waits More Important?
• LATCH_*, PAGELATCH_*
• PAGEIOLATCH_*, IO_COMPLETION, WRITELOG
• CXPACKET
• ASYNC_NETWORK_IO
• RESOURCE_SEMAPHORE
• BACKUPIO
• Lots and lots more
• signal_wait_time_ms
Are Some Waits Less Important?
• CXPACKET
• WAITFOR
• CLR_SEMAPHORE
• BROKER_RECEIVE_WAITFOR
• ONDEMAND_TASK_QUEUE
• Lots and lots more
How Do I Use This Information?
• Filter out the unimportant waits
• You know where your system bottlenecks are
• Is it system related?
• Is it query related?
• Is it structure related?
How Do I Know Which Queries
Are Waiting?
• Sys.dm_os_waiting_tasks
How Do I Know Which Waits A
Query Has?
• Sys.dm_exec_requests
• Extended Events: wait_info
What Happens To Waits Over
Time?
• DBCC SQLPERF(“sys.dm_os_wait_stats”,CLEAR)
• DBCC SQLPERF(“sys.dm_os_latch_stats”,CLEAR)
• Instance restart
DEMO: Wait Stats in SQL
Monitor
SQL Monitor
• Clear insights into SQL Server performance
in real time
• Embedded expertise
• Alerting
• Baselines
• Wait stats & expensive queries
• Custom Metrics
• SQL Monitor
SQL Monitor
• Read more experiences of SQL Monitor from real customers at: www.red-
gate.com/products/dba/sql-monitor
• We use it to monitor SQLServerCentral, if you want to see how it works:
http://monitor.red-gate.com
Its very simple to use and doesn’t
drown me in unnecessary
information. It came out on top for
being reasonably priced and also
functionality. We now have a stable
SQL Estate due to SQL Monitor.
Nic Hopper, Senior DBA, Atrium Underwriters Ltd
Documents
• SQL Server Performance Tuning Using Wait Statistics
• Performance Tuning Using Waits and Queues (old, but still good)
• Wait statistics, or please tell me where it hurts – Paul Randal
• What Queries Are Causing My Waits – John Sterret
Thank you for your attention
Q & A
The Importance of Wait Statistics in SQL Server
The Importance of Wait Statistics in SQL Server

More Related Content

What's hot (20)

PDF
Office Online Server 2016 - a must for on-premises installation for SharePoin...
SPC Adriatics
 
PDF
Building Search Engines - Lucene, SolR and Elasticsearch
Rahul Singh
 
PDF
10 Tips to Pump Up Your Atlassian Performance
Atlassian
 
PDF
Tracing Java Applications on Azure
CodeOps Technologies LLP
 
PDF
JIRA Data Center Implementation at Pitney Bowes - Peter Strickland
Atlassian
 
PPTX
Troubleshooting common scenarios with Always On - A Dress Rehearsal
Amit Banerjee
 
PPTX
Azure functions
EducationTamil
 
PPTX
Enhancements to High Availability, Disaster Recovery and Replication
Amit Banerjee
 
PPTX
Serverless Code Deployments in AWS
Marko Tomic
 
PPTX
Site speed Server Optimization
Shelly Fagin
 
PPTX
Building Enterprise Search Engines using Open Source Technologies
Rahul Singh
 
PDF
ECS19 - Thomas Vochten - ESSENTIAL DATABASE ADMINISTRATION SKILLS FOR SHAREPO...
European Collaboration Summit
 
PDF
From Concept to Clustered JAC (jira.atlassian.com) - Graham Carrick
Atlassian
 
PPTX
AlwaysOn Troubleshooting Improvements
Amit Banerjee
 
PDF
User-percieved performance
Mike North
 
PDF
Moving to the APEX Listener
Dimitri Gielis
 
PPTX
Debugging made easier with extended events
Amit Banerjee
 
PPTX
Always On Availability Group Troubleshooting Ninja
Amit Banerjee
 
PDF
Best practices deploying Sitecore to Microsoft Azure
Thom Puiman
 
PDF
Azure DevOps Multistage YAML Pipelines – Top 10 Features
Marc Müller
 
Office Online Server 2016 - a must for on-premises installation for SharePoin...
SPC Adriatics
 
Building Search Engines - Lucene, SolR and Elasticsearch
Rahul Singh
 
10 Tips to Pump Up Your Atlassian Performance
Atlassian
 
Tracing Java Applications on Azure
CodeOps Technologies LLP
 
JIRA Data Center Implementation at Pitney Bowes - Peter Strickland
Atlassian
 
Troubleshooting common scenarios with Always On - A Dress Rehearsal
Amit Banerjee
 
Azure functions
EducationTamil
 
Enhancements to High Availability, Disaster Recovery and Replication
Amit Banerjee
 
Serverless Code Deployments in AWS
Marko Tomic
 
Site speed Server Optimization
Shelly Fagin
 
Building Enterprise Search Engines using Open Source Technologies
Rahul Singh
 
ECS19 - Thomas Vochten - ESSENTIAL DATABASE ADMINISTRATION SKILLS FOR SHAREPO...
European Collaboration Summit
 
From Concept to Clustered JAC (jira.atlassian.com) - Graham Carrick
Atlassian
 
AlwaysOn Troubleshooting Improvements
Amit Banerjee
 
User-percieved performance
Mike North
 
Moving to the APEX Listener
Dimitri Gielis
 
Debugging made easier with extended events
Amit Banerjee
 
Always On Availability Group Troubleshooting Ninja
Amit Banerjee
 
Best practices deploying Sitecore to Microsoft Azure
Thom Puiman
 
Azure DevOps Multistage YAML Pipelines – Top 10 Features
Marc Müller
 

Similar to The Importance of Wait Statistics in SQL Server (20)

PPTX
Wait Watchers ; Gain SQL Performance Increases Fast!
Richard Douglas
 
PDF
Analyzing SQL Server wait stats, hands-on!
Red Gate Software
 
PPTX
End-to-end Troubleshooting Checklist for Microsoft SQL Server
Kevin Kline
 
PDF
What are you waiting for
Jason Strate
 
PDF
Troubleshooting sql server
Antonios Chatzipavlis
 
PDF
What are you waiting for? (#SQLSat211)
Jason Strate
 
PPTX
SQL Server Wait Types Everyone Should Know
Dean Richards
 
PPTX
SQL Server Admin Best Practices with DMV's
Sparkhound Inc.
 
PDF
7 steps to effective SQL Server monitoring
Red Gate Software
 
PPTX
What Are Your Servers Doing While You’re Sleeping?
Tracy McKibben
 
PPTX
Sql server performance tuning
Jugal Shah
 
PPTX
Sqlwatch presentation 2018-11
Marcin Gminski
 
PPT
AWR, ADDM, ASH, Metrics and Advisors.ppt
bugzbinny
 
PPTX
Sql waits
Miroslav Dimitrov
 
PPTX
OUGLS 2016: How profiling works in MySQL
Georgi Kodinov
 
PDF
Back 2 basics - SSMS Tips (IDf)
sqlserver.co.il
 
PDF
Back2 Basic Tools
sqlserver.co.il
 
PDF
OSMC 2010 | NSClient++ - what's new? And what's coming! by Michael Medin
NETWAYS
 
PPTX
Emergency Toolkit Presentation
Rich Benner
 
PDF
Pssdiag and sql nexus
Harsh Chawla
 
Wait Watchers ; Gain SQL Performance Increases Fast!
Richard Douglas
 
Analyzing SQL Server wait stats, hands-on!
Red Gate Software
 
End-to-end Troubleshooting Checklist for Microsoft SQL Server
Kevin Kline
 
What are you waiting for
Jason Strate
 
Troubleshooting sql server
Antonios Chatzipavlis
 
What are you waiting for? (#SQLSat211)
Jason Strate
 
SQL Server Wait Types Everyone Should Know
Dean Richards
 
SQL Server Admin Best Practices with DMV's
Sparkhound Inc.
 
7 steps to effective SQL Server monitoring
Red Gate Software
 
What Are Your Servers Doing While You’re Sleeping?
Tracy McKibben
 
Sql server performance tuning
Jugal Shah
 
Sqlwatch presentation 2018-11
Marcin Gminski
 
AWR, ADDM, ASH, Metrics and Advisors.ppt
bugzbinny
 
OUGLS 2016: How profiling works in MySQL
Georgi Kodinov
 
Back 2 basics - SSMS Tips (IDf)
sqlserver.co.il
 
Back2 Basic Tools
sqlserver.co.il
 
OSMC 2010 | NSClient++ - what's new? And what's coming! by Michael Medin
NETWAYS
 
Emergency Toolkit Presentation
Rich Benner
 
Pssdiag and sql nexus
Harsh Chawla
 
Ad

More from Grant Fritchey (20)

PDF
You Need a PostgreSQL Restore Plan Presentation
Grant Fritchey
 
PDF
PostgreSQL Query Performance Monitoring for the Absolute Beginner
Grant Fritchey
 
PDF
Leveraging AI for the PostgreSQL DBA #pgconf.eu
Grant Fritchey
 
PDF
Exploring Execution Plans, Learning to Read SQL Server Execution Plans
Grant Fritchey
 
PPTX
SQL Server Performance Tuning: Common Problems, Possible Solutions
Grant Fritchey
 
PDF
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
PPTX
Migrating To PostgreSQL
Grant Fritchey
 
PPTX
PostgreSQL Performance Problems: Monitoring and Alerting
Grant Fritchey
 
PDF
Automating Database Deployments Using Azure DevOps
Grant Fritchey
 
PDF
Learn To Effectively Use Extended Events_Techorama.pdf
Grant Fritchey
 
PDF
Using Query Store to Understand and Control Query Performance
Grant Fritchey
 
PPTX
You Should Be Standing Here: Learn How To Present a Session
Grant Fritchey
 
PDF
Redgate Community Circle: Tools For SQL Server Performance Tuning
Grant Fritchey
 
PDF
10 Steps To Global Data Compliance
Grant Fritchey
 
PDF
Time to Use the Columnstore Index
Grant Fritchey
 
PDF
Introduction to SQL Server in Containers
Grant Fritchey
 
PDF
DevOps for the DBA
Grant Fritchey
 
PDF
SQL Injection: How It Works, How to Stop It
Grant Fritchey
 
PDF
Privacy and Protection in the World of Database DevOps
Grant Fritchey
 
PDF
SQL Server Tools for Query Tuning
Grant Fritchey
 
You Need a PostgreSQL Restore Plan Presentation
Grant Fritchey
 
PostgreSQL Query Performance Monitoring for the Absolute Beginner
Grant Fritchey
 
Leveraging AI for the PostgreSQL DBA #pgconf.eu
Grant Fritchey
 
Exploring Execution Plans, Learning to Read SQL Server Execution Plans
Grant Fritchey
 
SQL Server Performance Tuning: Common Problems, Possible Solutions
Grant Fritchey
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
Migrating To PostgreSQL
Grant Fritchey
 
PostgreSQL Performance Problems: Monitoring and Alerting
Grant Fritchey
 
Automating Database Deployments Using Azure DevOps
Grant Fritchey
 
Learn To Effectively Use Extended Events_Techorama.pdf
Grant Fritchey
 
Using Query Store to Understand and Control Query Performance
Grant Fritchey
 
You Should Be Standing Here: Learn How To Present a Session
Grant Fritchey
 
Redgate Community Circle: Tools For SQL Server Performance Tuning
Grant Fritchey
 
10 Steps To Global Data Compliance
Grant Fritchey
 
Time to Use the Columnstore Index
Grant Fritchey
 
Introduction to SQL Server in Containers
Grant Fritchey
 
DevOps for the DBA
Grant Fritchey
 
SQL Injection: How It Works, How to Stop It
Grant Fritchey
 
Privacy and Protection in the World of Database DevOps
Grant Fritchey
 
SQL Server Tools for Query Tuning
Grant Fritchey
 
Ad

Recently uploaded (20)

PPTX
Insurance-Analytics-Branch-Dashboard (1).pptx
trivenisapate02
 
PPTX
isaacnewton-250718125311-e7ewqeqweqwa74d99.pptx
MahmoudHalim13
 
PPTX
apidays Munich 2025 - Effectively incorporating API Security into the overall...
apidays
 
PDF
apidays Munich 2025 - Integrate Your APIs into the New AI Marketplace, Senthi...
apidays
 
PPTX
materials that are required to used.pptx
drkaran1421
 
PDF
[1library.net] creating a culture of cyber security at work
University of [X]
 
PDF
apidays Munich 2025 - The life-changing magic of great API docs, Jens Fischer...
apidays
 
PPTX
GLOBAL_Gender-module-5_committing-equity-responsive-budget.pptx
rashmisahu90
 
PPTX
Enterprise Architecture and TOGAF Presn
starksolutionsindia
 
PPTX
Slide studies GC- CRC - PC - HNC baru.pptx
LLen8
 
PPTX
UVA-Ortho-PPT-Final-1.pptx Data analytics relevant to the top
chinnusindhu1
 
PPTX
fashion industry boom.pptx an economics project
TGMPandeyji
 
PDF
Basotho Satisfaction with Electricity(Statspack)
KatlehoMefane
 
PPT
introdution to python with a very little difficulty
HUZAIFABINABDULLAH
 
PPTX
apidays Munich 2025 - Agentic AI: A Friend or Foe?, Merja Kajava (Aavista Oy)
apidays
 
PPT
From Vision to Reality: The Digital India Revolution
Harsh Bharvadiya
 
PDF
apidays Munich 2025 - Automating Operations Without Reinventing the Wheel, Ma...
apidays
 
PPTX
MR and reffffffvvvvvvvfversal_083605.pptx
manjeshjain
 
PDF
Dr. Robert Krug - Chief Data Scientist At DataInnovate Solutions
Dr. Robert Krug
 
PDF
apidays Munich 2025 - Geospatial Artificial Intelligence (GeoAI) with OGC API...
apidays
 
Insurance-Analytics-Branch-Dashboard (1).pptx
trivenisapate02
 
isaacnewton-250718125311-e7ewqeqweqwa74d99.pptx
MahmoudHalim13
 
apidays Munich 2025 - Effectively incorporating API Security into the overall...
apidays
 
apidays Munich 2025 - Integrate Your APIs into the New AI Marketplace, Senthi...
apidays
 
materials that are required to used.pptx
drkaran1421
 
[1library.net] creating a culture of cyber security at work
University of [X]
 
apidays Munich 2025 - The life-changing magic of great API docs, Jens Fischer...
apidays
 
GLOBAL_Gender-module-5_committing-equity-responsive-budget.pptx
rashmisahu90
 
Enterprise Architecture and TOGAF Presn
starksolutionsindia
 
Slide studies GC- CRC - PC - HNC baru.pptx
LLen8
 
UVA-Ortho-PPT-Final-1.pptx Data analytics relevant to the top
chinnusindhu1
 
fashion industry boom.pptx an economics project
TGMPandeyji
 
Basotho Satisfaction with Electricity(Statspack)
KatlehoMefane
 
introdution to python with a very little difficulty
HUZAIFABINABDULLAH
 
apidays Munich 2025 - Agentic AI: A Friend or Foe?, Merja Kajava (Aavista Oy)
apidays
 
From Vision to Reality: The Digital India Revolution
Harsh Bharvadiya
 
apidays Munich 2025 - Automating Operations Without Reinventing the Wheel, Ma...
apidays
 
MR and reffffffvvvvvvvfversal_083605.pptx
manjeshjain
 
Dr. Robert Krug - Chief Data Scientist At DataInnovate Solutions
Dr. Robert Krug
 
apidays Munich 2025 - Geospatial Artificial Intelligence (GeoAI) with OGC API...
apidays
 

The Importance of Wait Statistics in SQL Server

  • 1. The Importance of Wait Statistics in Monitoring SQL Server Grant Fritchey
  • 3. What is a Wait? • SQL Server does work • All the work doesn’t occur simultaneously • When a unit of work stops • Threads – RUNNING – SUSPENDED – RUNNABLE • Time spent between RUNNING and RUNNING
  • 4. Why Are Waits Important? • Why is the server slow • Where is the server slow • Which resources are waiting frequently • Which resources are waiting long • Direct pointer to the cause of poor performance
  • 5. Where Do I Get Waits • Sys.dm_os_wait_stats • Sys.dm_db_wait_stats • sys.dm_os_latch_stats
  • 6. Are Some Waits More Important? • LATCH_*, PAGELATCH_* • PAGEIOLATCH_*, IO_COMPLETION, WRITELOG • CXPACKET • ASYNC_NETWORK_IO • RESOURCE_SEMAPHORE • BACKUPIO • Lots and lots more • signal_wait_time_ms
  • 7. Are Some Waits Less Important? • CXPACKET • WAITFOR • CLR_SEMAPHORE • BROKER_RECEIVE_WAITFOR • ONDEMAND_TASK_QUEUE • Lots and lots more
  • 8. How Do I Use This Information? • Filter out the unimportant waits • You know where your system bottlenecks are • Is it system related? • Is it query related? • Is it structure related?
  • 9. How Do I Know Which Queries Are Waiting? • Sys.dm_os_waiting_tasks
  • 10. How Do I Know Which Waits A Query Has? • Sys.dm_exec_requests • Extended Events: wait_info
  • 11. What Happens To Waits Over Time? • DBCC SQLPERF(“sys.dm_os_wait_stats”,CLEAR) • DBCC SQLPERF(“sys.dm_os_latch_stats”,CLEAR) • Instance restart
  • 12. DEMO: Wait Stats in SQL Monitor
  • 13. SQL Monitor • Clear insights into SQL Server performance in real time • Embedded expertise • Alerting • Baselines • Wait stats & expensive queries • Custom Metrics • SQL Monitor
  • 14. SQL Monitor • Read more experiences of SQL Monitor from real customers at: www.red- gate.com/products/dba/sql-monitor • We use it to monitor SQLServerCentral, if you want to see how it works: http://monitor.red-gate.com
  • 15. Its very simple to use and doesn’t drown me in unnecessary information. It came out on top for being reasonably priced and also functionality. We now have a stable SQL Estate due to SQL Monitor. Nic Hopper, Senior DBA, Atrium Underwriters Ltd
  • 16. Documents • SQL Server Performance Tuning Using Wait Statistics • Performance Tuning Using Waits and Queues (old, but still good) • Wait statistics, or please tell me where it hurts – Paul Randal • What Queries Are Causing My Waits – John Sterret
  • 17. Thank you for your attention Q & A

Editor's Notes

  • #4: Remember, you’ll always have waits.
  • #6: Sys.dm_os_wait_stats clears on restart, you can also use DBCC SQLPERF
  • #7: Cautions regarding looking at any single value. All must evaluated as a part of all the other stuff