📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

📚 Interview question

Your ASP.NET app starts throwing 'Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool' at peak times. How do you find the cause?

Mid-Level Theory Intermediate

🎯 Key points

  • Distinguish leak, slow queries and high concurrency
  • SqlClient event counters for active/free connections
  • sys.dm_exec_sessions sleeping vs running; sys.dm_exec_requests waits and blocking
  • Azure SQL Query Performance Insight and Application Insights dependency calls
  • Check for fragmented pools (varying connection strings) and retry storms
  • Memory dump or code review for undisposed connections and readers
  • Raise Max Pool Size last, if ever

⏱ 30-second answer

First tell leak from slow queries from too much concurrency. Check SqlClient event counters (active vs free connections) or sys.dm_exec_sessions for the app's program_name: many sleeping sessions means connections held but idle (leak, open readers, long transactions); many running/suspended means slow queries or blocking (check sys.dm_exec_requests, wait types, Query Store; in Azure SQL also Query Performance Insight and Application Insights dependency telemetry). Check the configuration too: connection strings that differ per request fragment the pool, and a request spike or retry storm can exceed 100 concurrent queries even without a leak. On .NET Framework, a memory dump showing many undisposed SqlConnection/SqlDataReader objects confirms a leak; in code, look for connections not in using or held across slow calls. Fix the leak, tune the slow query, or limit concurrency; only then reconsider Max Pool Size.

🔍 What the interviewer is checking

Checks they can diagnose leaks versus slow queries versus too much concurrency

↩ Usually asked after

More in Legacy Technologies

Last updated 23 Nov 2026.

🌐 Sangam's Webring

⏪ Previous 🏠 Main Next ⏩
💬 Chat with me