CXPACKET and SOS_Scheduler_yeild waits

Samantha r 1,326 Reputation points

Hi All, One of the app query is running slow. When I saw the spid's waitype, it is CXPACKET. After digging further one of the thread is waiting for SOS_SCHEDULER_YIELD. question I have is, except this query nothing else is running at that moment. only small other queries coming and exiting. When I observed the windows task manager, Server CPU usage is under 15% utilization. VM has 32 cpus. Why it is had to wait for SOS_SCHEDULER_YIELD.when it is not a high cpu condition on the server? How to troubleshoot and fix such queries? Regards,

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,236 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Erland Sommarskog 98,636 Reputation points

    Exactly what are you looking at? The wait time or numbers of waits? It's quite normal to have a high number of SOS_SCHEDULER_YIELD waits when you have a CPU-intensive process. This is because all code in SQL Server voluntary yields after around 4 ms to permit other tasks to run. But if there is free CPU, the wait should be very short.

    1 person found this answer helpful.