I have a process that has a last_wait_type as SOS_Scheduler_Yield. It is inserting 100 records to a table. This process has been with this wait type forever with low CPU utilization %.
There are other processes executing the same query simultaneously without this wait type and executing in minutes. What could be the reason for this process hanging? It has been in runnable state with Last_wait_type as SOS_Scheduler_Yield for that long.
Best Answer
The simple occurrence of
SOS_Scheduler_Yield
don't mean very much. This can have some other causes.Generally you can take a look at this
DMV
to clarify some things.Interpretation of
dm_os_wait_stats
:Another good resource to look at may be the schedulers itself:
It will provide you the status of each CPU. Basically description of this statement:
NUMA
node of the core.affinity_mask
)context_switches_count
tends to show that the CPU cycles between different operations whileidle_switches_count
indicates if the CPU goes often idle and back to work or not. Generally lowidle_switches_count
indicates that your system is under permanent pressure.Hopefully this will clarify things for you.