Wandenkolk さんのプロフィールWandenkolk Netoフォトブログつながりその他 ツール ヘルプ
9月20日

SOS_Scheduler_Yield

 

I guess many people had the same problem. So i´m gonna translate the post i´ve wrote in portuguese.

In fact, i was doing some testing on a Fujitsu Primequest machine, and the question about SOS_SCHEDULER_YIELD popped up.

In doing some research i found out a reference regarding high values of this SOS_SCHEDULER_YIELD. You can check this information querying the sys.dm_os_scheduler and sys.dm_exec_sessions.

High values of this value, can indicate some cpu pressure. it says how often the cpu has to yield to another process to allow it to execut. a number very high of it says that you have many processes for a few cpu.

look at these numbers:

Here are the results from the sys.dm_os_wait_stats, sys.dm_exec_sessions and sys.os_schedulers views for one of the two killCPU sessions:

wait_type                 waits  wait_time            signal_wait_time 
------------------------- ------ -------------------- ----------------
SOS_SCHEDULER_YIELD       15078  58766                58766         
WRITELOG                  4      15                   15         


session_id CPU_time             tot_sched_time elapsed_time PIO  writes   LIO
---------- -------------------- -------------- ------------ ---- -------- ------
56         31219                31463          60915        6    27       291897


sched_id    preemptive_switches  context_switches     idle_switches  yield_count
----------- -------------------- -------------------- -------------  ------------
0           1                    45                   93             260    
1           0                    14631                16             15264  

But to watching these numbers in an instant can be tricky. So what you should do is to create a job to record the numbers and watch them over time. In doing this you gonna get a lot of information that could be hard to understand, storing these data in tables can make the analysys job easier though.

it worth a lot to take a look in this article:
http://www.microsoft.com/technet/prodtechnol/sql/2005/tsprfprb.mspx