This is one of the most painful production issues:
async calls sometimes never complete under high load.
🔍 Root Cause: ThreadPool Starvation + Sync-over-Async
If your code blocks threads, the async continuations never get a chance to run.
Task.Run(() =>
{
Thread.Sleep(3000); // ❌ Blocks threadpool
});
Eventually, under load:
-
Tasks queue up
-
ThreadPool can’t spawn fast enough
-
API timeouts explode
-
Async awaits never resume
✔ The Real Fix (Rarely Explained Clearly)
Use pure async:
await Task.Delay(3000);
✔ But Here’s the Actual Life-Saving Part
Increase min worker threads:
ThreadPool.SetMinThreads(200, 200);
This single line has saved hundreds of production systems.
💡 Bonus Diagnostics
Use:
ThreadPool.GetAvailableThreads(out var worker, out var io);
If “available threads” is low → you’re starving.





