What Are You Waiting For? Common Core + Global = Global Ready
What are you waiting for
-
Upload
jason-strate -
Category
Documents
-
view
244 -
download
1
Transcript of What are you waiting for
![Page 1: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/1.jpg)
What Are You Waiting For? Performing Wait Stat Analysis
![Page 2: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/2.jpg)
Introduction
Jason Strate
b: www.jasonstrate.com
t: StrateSQL
Resources jasonstrate.com/go/Waits
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
![Page 3: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/3.jpg)
What Are You Waiting For?
You…
• SQL Server
• Developers
• DBAs
![Page 4: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/4.jpg)
Agenda
Defining
Viewing
Collecting
Reviewing
![Page 5: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/5.jpg)
Agenda
Defining
Viewing
Collecting
Reviewing
![Page 6: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/6.jpg)
Wait, wait… I’ll Tell You
Waits: Resource waits occur when a worker requests access to a resource that is not available because the resource is being used by some other worker or is not yet available.
![Page 7: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/7.jpg)
So What?!
![Page 8: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/8.jpg)
Wait Statistics
Identity
Measure Prioritize
![Page 9: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/9.jpg)
Execution Model (Simplified)
Grocery Store
• Cashier – Scheduler
• Customer – Query
• Checkout Line – Queue
• Running
• Runnable
• Suspended
![Page 10: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/10.jpg)
Execution Model (Simplified)
RUNNING
![Page 11: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/11.jpg)
Execution Model (Simplified)
RUNNABLE RUNNING
![Page 12: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/12.jpg)
Execution Model (Simplified)
RUNNABLE RUNNING
SUSPENDED
WAIT
![Page 13: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/13.jpg)
Execution Model (Simplified)
RUNNING RUNNABLE
SUSPENDED
![Page 14: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/14.jpg)
Execution Model (Simplified)
RUNNING RUNNABLE
WAIT TIME
SUSPENDED
![Page 15: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/15.jpg)
Execution Model (Simplified)
RUNNING
SUSPENDED
RUNNABLE
![Page 16: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/16.jpg)
Execution Model (Simplified)
RUNNING
SUSPENDED
RUNNABLE
![Page 17: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/17.jpg)
Execution Model (Simplified)
RUNNING
SUSPENDED
RUNNABLE
SIGNAL WAIT TIME
![Page 18: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/18.jpg)
Agenda-ing
Defining
Viewing
Collecting
Reviewing
![Page 19: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/19.jpg)
Wait DMVs
• sys.dm_os_wait_stats
– Accumulated statistics on tasks that have waited for resources
• sys.dm_os_waiting_tasks
– Information on queued tasks waiting for resources
![Page 20: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/20.jpg)
Waits Stats
![Page 21: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/21.jpg)
Waits Stats
Name of the wait type.
![Page 22: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/22.jpg)
Waits Stats
Number of waits on this wait type. This counter is
incremented at the start of each wait.
![Page 23: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/23.jpg)
Waits Stats
Total wait time for this wait type in milliseconds. This
time is inclusive of signal_wait_time_ms.
![Page 24: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/24.jpg)
Waits Stats
Maximum wait time on this wait type.
![Page 25: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/25.jpg)
Waits Stats
Difference between the time that the waiting thread
was signaled and when it started running.
![Page 26: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/26.jpg)
Waiting Tasks
![Page 27: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/27.jpg)
Waiting Tasks
![Page 28: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/28.jpg)
Waiting Tasks
ID of the session associated with the task.
![Page 29: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/29.jpg)
Waiting Tasks
Total wait time for this wait type, in milliseconds. This
time is inclusive of signal_wait_time.
![Page 30: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/30.jpg)
Waiting Tasks
Name of the wait type.
![Page 31: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/31.jpg)
Waiting Tasks
ID of the session that is blocking the request. If this column is NULL, the request is not blocked, or the session information of the blocking session is not
available
![Page 32: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/32.jpg)
Waiting Tasks
Difference between the time that the waiting thread
was signaled and when it started running.
![Page 33: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/33.jpg)
VIEWING WAIT STATS Demo
![Page 34: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/34.jpg)
Agenda
Defining
Viewing
Collecting
Reviewing
![Page 35: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/35.jpg)
DMV Stats
![Page 36: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/36.jpg)
Management Data Warehouse
![Page 37: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/37.jpg)
Do-It-Yourself
Collect Summarize Analyze
![Page 38: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/38.jpg)
DO-IT-YOURSELF Demo
![Page 39: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/39.jpg)
Agenda
Defining
Viewing
Collecting
Reviewing
![Page 40: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/40.jpg)
Wait Types
• Tied to process – Audit – Buffer – I/O – Indexing – Lock – SQLOS
• Categories – Background – External – Queue
![Page 41: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/41.jpg)
Background Waits
CLR_SEMAPHORE
LAZYWRITER_SLEEP
RESOURCE_QUEUE
SLEEP_TASK
SLEEP_SYSTEMTASK
WAITFOR
LOGMGR_QUEUE
CHECKPOINT_QUEUE
XE_TIMER_EVENT
BROKER_TO_FLUSH
BROKER_TASK_STOP
CLR_MANUAL_EVENT
CLR_AUTO_EVENT
XE_DISPATCHER_WAIT
Not all inclusive
![Page 42: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/42.jpg)
CXPACKET
• Contention with queries the at are executing in parallel; across multiple CPUs. Generally due to unbalanced execution across CPUs or tasks ahead of query executing longer than expected.
Translation
• >5% for OLTP
• >10% for data warehouses
Guideline
• Review indexing
• Tune queries
• Adjust Max Degree of parallelism
• Research cost threshold for parallelism
Resolution
![Page 43: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/43.jpg)
OLEDB
• Occurs when SQL Server calls the Microsoft SQL Native Client OLE DB Provider. It indicates the duration of calls to the OLE DB provider.
Translation
• Examine when it is a top wait and exceeds background waits. (TOP 5)
Guideline
• Identify queries with OLE DB waits with extended events or sys.dm_os_waiting_tasks
• Check application placement and Disk secs/Read and Disk secs/Write
• Tune transactions using RPC, Distributed (Linked Server), and Full Text Search
Resolution
![Page 44: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/44.jpg)
PAGEIOLATCH_x
• Contention caused by disk to memory transfer. Typically suggests disk IO
subsystem issues.
Translation
• Examine when it is a top wait and exceeds background waits. (TOP 5)
Guideline
• Review Physical disk: disk seconds/read and Physical disk: disk seconds/write and SQL Server Buffer Manager: Page Life Expectancy
• Review information for virtual file stats
• Reconfigure disk to improve IO throughput
• Analyze indexes to reduce need to move data to memory
• Increase memory to increase data available to SQL Server
Resolution
![Page 45: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/45.jpg)
PAGELATCH_x
• Contention between short term light weight synchronization objects. Latches
are not held for the duration of a transaction. Occur in the buffer pool but unrelated to IO requests.
Translation
• Examine when it is a top wait and exceeds background waits. (TOP 5)
Guideline
• Check tempdb configuration
• Additional data files
• Trace Flag 1118
• Troubleshoot memory pressure
Resolution
![Page 46: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/46.jpg)
LATCH_x
• Contention between short term light weight synchronization objects. Latches are not held for the duration of a transaction. Non buffer pool related.
Translation
• Examine when it is a top wait and exceeds background waits. (TOP 5)
Guideline
• Review T-SQL generating LATCH waits using extended events.
• Examine memory items in sys.dm_os_latch_stats
• Partition table across multiple files
Resolution
![Page 47: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/47.jpg)
Additional Resources
•http://is.gd/qWGGnd Waits and Queues
•http://is.gd/gvD80N SQLServerPedia
•http://is.gd/r59976 SQL Server Wait Type
Repository
•http://is.gd/khsduZ Wait Stats Introductory
References
•http://is.gd/dQWFwC Joe Sack
•http://is.gd/VlH71l
•http://is.gd/xggZSA Management Data Warehouse
•http://sqldmvstats.codeplex.com DMVstats
![Page 48: What are you waiting for](https://reader031.fdocuments.us/reader031/viewer/2022020207/55876bf7d8b42ad30b8b4690/html5/thumbnails/48.jpg)
Services Speed development through training, and rapid development services from Pragmatic Works.
Products BI products to covert to a Microsoft BI platform and simplify development on the platform.
Foundation Helping those who do not have the means to get into information technology achieve their dreams.
For more information…
Name: Jason Strate Email: [email protected] Blog: www.jasonstrate.com Resource: jasonstrate.com/go/waits