October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

What Causes Database Connection Pool Exhaustion in ASP.NET Core?

Connection pool exhaustion means every connection in a driver pool is in use. Find the likely causes, understand SqlClient defaults, and diagnose the issue before changing limits.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Database connection pool exhaustion occurs when an application asks its database driver for a connection and every connection in the relevant pool is already in use. New callers wait for a pool slot; if one does not become available before the connection timeout, the request fails. In the common ASP.NET Core and EF Core setup using SQL Server, Microsoft.Data.SqlClient manages this connection pool. The immediate issue is unavailable pooled connections—not necessarily a database outage.

What the pool-exhaustion error means

Microsoft describes the familiar timeout as occurring when an application cannot obtain a connection because all pooled connections are in use and the pool has reached its maximum. Its SqlClient troubleshooting guide summarizes the situation: “Client application is opening more connections than the connection pool can hold active at a given time.” That describes the condition, not the underlying reason connections remain unavailable.

As an Amazon Associate I earn from qualifying purchases.

In EF Core, connection pooling is provided by the database driver. EF Core generally opens a connection for an operation and closes it afterward, returning it to the driver’s pool for reuse. EF Core’s optional DbContext pooling is separate: reusing context instances does not increase the driver’s connection-pool capacity. The distinction is covered in Microsoft’s EF Core performance guidance.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Common causes to investigate

Pool exhaustion is a symptom, so establish what is keeping connections checked out and how much concurrent work is competing for them. No single coding mistake explains every incident.

Connections, readers, or manual opens are not released promptly

Review code that creates or opens a SqlConnection, uses a data reader, or manually opens the EF Core connection. Make sure each resource is disposed or closed as soon as its work is complete. EF Core’s ordinary open-per-operation behavior helps return connections promptly, but manual ADO.NET use can extend their lifetime. Microsoft’s troubleshooting guidance specifically advises closing unused connections promptly.

Operations keep connections occupied for a long time

Slow database commands and long-running transactions can leave connections unavailable while other requests arrive. Examine the duration of commands and transactions alongside the time connections are checked out. A command taking a long time is not the same as a connection-acquisition timeout, but prolonged use can contribute to competition for pool slots.

Concurrent demand exceeds the available pool capacity

A burst of concurrent requests can need more connections at once than a particular pool can provide, even if connections are eventually returned. The documented SqlClient maximum is per distinct pool, not a global ceiling for an entire ASP.NET Core service. Multiple deployed application instances can each create pools, and separate pool identities can also increase the total number of connections reaching the database.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Different connection settings or identities create separate pools

Before assuming that all requests share one pool, verify the provider and effective connection string used by each part of the application. Distinct connection strings can result in distinct pools. Microsoft also documents separate pools for different Windows identities when integrated security is used. Its SQL Server connection-pooling documentation explains pool grouping and identity behavior.

How to investigate the cause

  1. Identify the provider and endpoint. Confirm the database provider package, database endpoint, and effective connection string. EF Core’s SQL Server provider uses Microsoft.Data.SqlClient; other EF Core providers can have different pooling defaults and diagnostic tools. See Microsoft’s EF Core database providers overview.
  2. Check connection lifetimes. Inspect code paths that open connections or readers, especially manual ADO.NET usage. Verify that connections and readers are disposed promptly and that transactions do not remain open longer than intended.
  3. Separate acquisition timeouts from command timeouts. Determine whether the failure happens while obtaining a connection or while executing a database command. These are different waits with different settings.
  4. Compare concurrency and pool scope. Review how many application instances are running and whether connection strings or integrated-security identities divide work into multiple pools. A configured per-pool maximum does not describe aggregate connections across all instances and pools.
  5. Use provider diagnostics. For Microsoft.Data.SqlClient on .NET Core and .NET Standard, Microsoft documents event counters that can help show pool activity. When integrated security is involved, active pool-group and active-pool counts can be relevant. Consult the SqlClient event counters documentation.
  6. Check server capacity before changing limits. Estimate the aggregate connections that all pools and application instances could open, then confirm the database can accommodate them. Microsoft’s connection-string options guidance cautions that the server’s connection capacity matters when increasing a pool maximum.

SqlClient timeout and pool defaults

These figures are Microsoft.Data.SqlClient defaults, not guaranteed settings for every application. The effective values depend on the connection string and provider version, and each distinct pool has its own capacity.

Setting Documented default What it controls
Max Pool Size 100 connections per distinct pool Maximum connections in that pool. If they are all occupied, callers wait for a usable connection.
Connect Timeout 15 seconds Bounds connection establishment, including the wait for a pooled connection to become available.
Command Timeout 30 seconds Bounds command execution; it does not set the wait for a pool slot.

Microsoft documents the SqlClient connection options and defaults in its connection-string syntax reference and the SqlCommand.CommandTimeout reference.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choosing a fix without shifting the problem

  • If connections are held unnecessarily: correct their lifetime and disposal first. This frees existing capacity rather than asking the database to support more simultaneous sessions.
  • If genuine concurrent demand is high: use observed demand and database capacity to decide whether a higher per-pool maximum is appropriate. Account for all application instances and distinct pools, not just one connection string.
  • If the connection wait is expiring too soon: a longer Connect Timeout gives callers more time to obtain a slot, but does not make a connection available or increase pool capacity.
  • If a command itself is timing out: investigate command execution and Command Timeout; changing that setting does not resolve an exhausted pool.

Changing Max Pool Size without checking connection lifetimes, concurrency, and server capacity can move the bottleneck to the database. Treat any increase as a capacity decision supported by measurements, not as the default repair.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What a database health check can—and cannot—tell you

An EF Core health check that calls CanConnectAsync can test whether the configured database is reachable. It does not, by itself, explain why application requests cannot obtain a pooled connection. Use provider-specific pool diagnostics and inspect connection lifetimes to investigate exhaustion. See the EF Core health checks documentation.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.