There are a lot of posts about THREADPOOL on the internet, but what happens before your server threads go into the red?
You might see other signs of CPU contention — lots of waits on stuff like the CX waits, or SOS_SCHEDULER_YIELD.
But there are other signs, too, and they can show up in the lifecycle of a query.
The main states a query can be in are:
- Runing: Chugging happily along
- Runnable: Waiting for a CPU
- Suspended: Waiting on something else (locks, pages, whatever)
- Sleeping: Should probably disconnect maybe, I guess
If you’ve got a lot of queries that are runnable, they’re ready to run, but not getting CPU time.
There are a ton of reasons why you might see this rack up, like:
- Too few CPUs
- Totally untuned queries
- VM issues like noisy neighbors, CPU limits, etc.
- RBAR-style code
If > 25% of your queries are runnable, we’ll warn you about it. What you do with that information is up to your skilled hands.
- For sp_PressureDetector, the change will be there by the time this post drops
- For sp_BlitzFirst, watch for the February release
Thanks for reading!
If this is the kind of SQL Server stuff you love learning about, you’ll love my training. I’m offering a 75% discount on to my blog readers if you click from here. I’m also available for consulting if you just don’t have time for that and need to solve performance problems quickly.