How does blocking increase sos_scheduler_yield wait?



  • What is the correlation between blocking and CPU? Because I am reaching the conclusion that the blocking is causing my sos_scheduler_yield wait type to increase, but I would like to understand the reasoning, i.e. why is blocking (in particular waiting for LCK_M_SCH_S) causing high sos_scheduler_yield wait type. Is it the background tasks? Also the blocking is in tempdb.

    I first would like to confirm that my conclustion seems reasonable and then understand the connection.

    Thanks

    Extra: I am not convinced from the answer below. If queries time-out because of the blocking and then restart, it seems reasonable that sos_scheduler_yield wait type goes up.



  • There is no direct relationship. sos_scheduler_yield generally indicates CPU is a bottleneck, as sessions yielding the worker (cpu) are having to wait to get scheduled on a worker again.

    Blocking on LCK_M_SCH_S means that a session is performing DML and causing other sessions to wait.

    The sessions performing DML may also be driving high CPU utilization. For example if you're rebuilding all your indexes offline you would hold an Sch-M lock while performing a long-running CPU-intensive operation.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2