I am having a strange issue which i am unable to understand:
On my server with 64 Logical processors
having maxworkers
1472, there are peak periods in day where workers created
for an hour lets say goes beyond maxworkers available. Ranges somewhere 1800-1900
in that duration.
From what I can understand and saw is there a burst of blocking happening in that period. Lots of update commands blockings its own process while that UPDATE will block other inserts and selects over that range of couple of minutes.
However CPU does not tend to increase and stays steady at 30% on avg. Should the CPU not spike to 100% or atleast much higher than 30% when workers available are exhausted ? OR those waiting threads are not even on schedulers?
Please help me understand , thanks
Best Answer
Correlation between MaxWorkers created and CPU utilization
I strongly recommend you to read the Thread and Task Architecture Guide doc. I'll quote some relevant parts:
About the higher number of workers and the relation between maxworkers and CPU:
About the blocks you're experiencing:
About the CPU consumption not going beyond 30% while having requests blocking each other:
And here's the list of states a worker can be (from sys.dm_os_workers). Unless it's on the RUNNING state, it's not using the CPU, therefore, you could have way more requests existing at the same time than the 1472 you expected to see if they're not in fact using the CPU.
How to diagnostic your situation
With that in mind, you should check if you don't have a bottleneck caused by other resources (e.g., disk, network) required by the requests that are blocking the others. Paul Randal's article SQL Server Wait Statistics (or please tell me where it hurts…) has a terrific query to retrieve info about what could be causing trouble on your server. Before you assume the problem is the number of workers, I advise you to run that diagnostic on your server.