WHAT ARE YOU   Jason Strate               Database Architect               Pragmatic Works, Inc.WAITING FOR?
WHAT ARE YOU WAITING FOR?You…SQL ServerDevelopersDBAs
AGENDADefining   Viewing   Collecting   Reviewing
AGENDA            DefiningDefining   Viewing   Collecting   Reviewing
WAIT, WAIT… I’LL TELL YOUWaits & Queues Methodology
SO WHAT?!
WAIT STATISTICS        IdentityPrioritize    Measure
EXECUTION MODEL (SIMPLIFIED)Grocery Store Cashier   Scheduler Customer   Query Checkout Line   Queue     Running   ...
EXECUTION MODEL (SIMPLIFIED)                RUNNING
EXECUTION MODEL (SIMPLIFIED)  RUNNABLE      RUNNING
EXECUTION MODEL (SIMPLIFIED)  RUNNABLE          RUNNING             WAIT                    SUSPENDED
EXECUTION MODEL (SIMPLIFIED)  RUNNABLE      RUNNING                SUSPENDED
EXECUTION MODEL (SIMPLIFIED)   RUNNABLE     RUNNINGWAIT TIME                SUSPENDED
EXECUTION MODEL (SIMPLIFIED)  RUNNABLE      RUNNING                SUSPENDED
EXECUTION MODEL (SIMPLIFIED)  RUNNABLE      RUNNING                SUSPENDED
EXECUTION MODEL (SIMPLIFIED)       RUNNABLE   RUNNINGSIGNAL WAIT       SUSPENDED   TIME
AGENDA            ViewingDefining   Viewing   Collecting   Reviewing
WAIT DMVS sys.dm_os_wait_stats   Accumulated statistics on tasks that have waited for resources sys.dm_os_waiting_tasks...
WAITS STATS
WAITS STATS Name of the wait type.
WAITS STATSNumber of waits on this wait type. This counter is    incremented at the start of each wait.
WAITS STATSTotal wait time for this wait type in milliseconds. This      time is inclusive of signal_wait_time_ms.
WAITS STATSMaximum wait time on this wait type.
WAITS STATSDifference between the time that the waiting thread     was signaled and when it started running.
WAITING TASKS
WAITING TASKS
WAITING TASKSID of the session associated with the task.
WAITING TASKSTotal wait time for this wait type, in milliseconds. This        time is inclusive of signal_wait_time.
WAITING TASKS  Name of the wait type.
WAITING TASKSID of the session that is blocking the request. If this column is NULL, the request is not blocked, or the se...
WAITING TASKSDifference between the time that the waiting thread     was signaled and when it started running.
VIEWING WAIT STATS   Demo
AGENDA            CollectingDefining   Viewing   Collecting   Reviewing
DMV STATS
MANAGEMENT DATA WAREHOUSE
DO-IT-YOURSELFCollect     Summarize      Analyze
DO-IT-YOURSELF   Demo
AGENDA            ReviewingDefining   Viewing   Collecting   Reviewing
WAIT T YPES Tied to process     Audit     Buffer     I/O     Indexing     Lock     SQLOS Categories   Background ...
BACKGROUND WAITSCLR_SEMAPHORE      CHECKPOINT_QUEUELAZYWRITER_SLEEP   XE_TIMER_EVENTRESOURCE_QUEUE     BROKER_TO_FLUSH    ...
CXPACKETTranslation•Contention with queries the at are executing in parallel; across multiple CPUs. Generally due to unbal...
OLEDBTranslation• Occurs when SQL Server calls the Microsoft SQL Native Client OLE DB  Provider. It indicates the duration...
PAGEIOLATCH_XTranslation• Contention caused by disk to memory transfer. Typically suggests disk IO  subsystem issues.Guide...
PAGELATCH_XTranslation• Contention between short term light weight synchronization objects.  Latches are not held for the ...
LATCH_XTranslation• Contention between short term light weight synchronization objects.  Latches are not held for the dura...
SQL SERVER MVP DEEP DIVES, VOLUME 2                  www.operationsmile.org                  www.manning.com/delaney
RESOURCESJason       e: jstrate@pragmaticworks.comStrate            e: jasonstrate@gmail.com            b: www.jasonstrate...
Upcoming SlideShare
Loading in...5
×

What are you waiting for? (#SQLSat211)

410

Published on

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
410
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
12
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

What are you waiting for? (#SQLSat211)

  1. 1. WHAT ARE YOU Jason Strate Database Architect Pragmatic Works, Inc.WAITING FOR?
  2. 2. WHAT ARE YOU WAITING FOR?You…SQL ServerDevelopersDBAs
  3. 3. AGENDADefining Viewing Collecting Reviewing
  4. 4. AGENDA DefiningDefining Viewing Collecting Reviewing
  5. 5. WAIT, WAIT… I’LL TELL YOUWaits & Queues Methodology
  6. 6. SO WHAT?!
  7. 7. WAIT STATISTICS IdentityPrioritize Measure
  8. 8. EXECUTION MODEL (SIMPLIFIED)Grocery Store Cashier  Scheduler Customer  Query Checkout Line  Queue  Running  Runnable  Suspended
  9. 9. EXECUTION MODEL (SIMPLIFIED) RUNNING
  10. 10. EXECUTION MODEL (SIMPLIFIED) RUNNABLE RUNNING
  11. 11. EXECUTION MODEL (SIMPLIFIED) RUNNABLE RUNNING WAIT SUSPENDED
  12. 12. EXECUTION MODEL (SIMPLIFIED) RUNNABLE RUNNING SUSPENDED
  13. 13. EXECUTION MODEL (SIMPLIFIED) RUNNABLE RUNNINGWAIT TIME SUSPENDED
  14. 14. EXECUTION MODEL (SIMPLIFIED) RUNNABLE RUNNING SUSPENDED
  15. 15. EXECUTION MODEL (SIMPLIFIED) RUNNABLE RUNNING SUSPENDED
  16. 16. EXECUTION MODEL (SIMPLIFIED) RUNNABLE RUNNINGSIGNAL WAIT SUSPENDED TIME
  17. 17. AGENDA ViewingDefining Viewing Collecting Reviewing
  18. 18. 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
  19. 19. WAITS STATS
  20. 20. WAITS STATS Name of the wait type.
  21. 21. WAITS STATSNumber of waits on this wait type. This counter is incremented at the start of each wait.
  22. 22. WAITS STATSTotal wait time for this wait type in milliseconds. This time is inclusive of signal_wait_time_ms.
  23. 23. WAITS STATSMaximum wait time on this wait type.
  24. 24. WAITS STATSDifference between the time that the waiting thread was signaled and when it started running.
  25. 25. WAITING TASKS
  26. 26. WAITING TASKS
  27. 27. WAITING TASKSID of the session associated with the task.
  28. 28. WAITING TASKSTotal wait time for this wait type, in milliseconds. This time is inclusive of signal_wait_time.
  29. 29. WAITING TASKS Name of the wait type.
  30. 30. WAITING TASKSID 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
  31. 31. WAITING TASKSDifference between the time that the waiting thread was signaled and when it started running.
  32. 32. VIEWING WAIT STATS Demo
  33. 33. AGENDA CollectingDefining Viewing Collecting Reviewing
  34. 34. DMV STATS
  35. 35. MANAGEMENT DATA WAREHOUSE
  36. 36. DO-IT-YOURSELFCollect Summarize Analyze
  37. 37. DO-IT-YOURSELF Demo
  38. 38. AGENDA ReviewingDefining Viewing Collecting Reviewing
  39. 39. WAIT T YPES Tied to process  Audit  Buffer  I/O  Indexing  Lock  SQLOS Categories  Background  External  Queue
  40. 40. BACKGROUND WAITSCLR_SEMAPHORE CHECKPOINT_QUEUELAZYWRITER_SLEEP XE_TIMER_EVENTRESOURCE_QUEUE BROKER_TO_FLUSH Not all inclusiveSLEEP_TASK BROKER_TASK_STOPSLEEP_SYSTEMTASK CLR_MANUAL_EVENTWAITFOR CLR_AUTO_EVENTLOGMGR_QUEUE XE_DISPATCHER_WAIT
  41. 41. CXPACKETTranslation•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.Guideline•>5% for OLTP•>10% for data warehousesResolution•Review indexing•Tune queries•Adjust Max Degree of parallelism•Research cost threshold for parallelism
  42. 42. OLEDBTranslation• Occurs when SQL Server calls the Microsoft SQL Native Client OLE DB Provider. It indicates the duration of calls to the OLE DB provider.Guideline• Examine when it is a top wait and exceeds background waits. (TOP 5)Resolution• 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
  43. 43. PAGEIOLATCH_XTranslation• Contention caused by disk to memory transfer. Typically suggests disk IO subsystem issues.Guideline• Examine when it is a top wait and exceeds background waits. (TOP 5)Resolution• 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
  44. 44. PAGELATCH_XTranslation• 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.Guideline• Examine when it is a top wait and exceeds background waits. (TOP 5)Resolution• Check tempdb configuration • Additional data files • Trace Flag 1118• Troubleshoot memory pressure
  45. 45. LATCH_XTranslation• Contention between short term light weight synchronization objects. Latches are not held for the duration of a transaction. Non buffer pool related.Guideline• Examine when it is a top wait and exceeds background waits. (TOP 5)Resolution• Review T-SQL generating LATCH waits using extended events.• Examine memory items in sys.dm_os_latch_stats• Partition table across multiple files
  46. 46. SQL SERVER MVP DEEP DIVES, VOLUME 2  www.operationsmile.org  www.manning.com/delaney
  47. 47. RESOURCESJason e: jstrate@pragmaticworks.comStrate e: jasonstrate@gmail.com b: www.jasonstrate.com t: StrateSQLResources jasonstrate.com/go/Waits2013/
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×