October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

How to Size a Database Connection Pool for Your Application

A practical method for sizing a database connection pool: budget across replicas, test useful concurrency, and use pool and database metrics to tune it.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Size a database connection pool around useful concurrent database work—not your user count or a copied default. Set a maximum that lets the database make progress without creating harmful contention, then make sure every pool across every application instance fits within the database’s connection budget. Validate the setting under representative load while watching both pool and database metrics.

What a connection pool limit controls

A pool reuses database connections instead of repeatedly opening and closing them, and lets many clients share a smaller number of connections, as the pgJDBC documentation describes. Its maximum is also a concurrency limit: it caps how many operations can hold a connection from that pool at once.

For example, HikariCP’s maximumPoolSize counts both idle and in-use connections. When all connections are occupied, another caller waits up to connectionTimeout for one to become available; if none does, acquisition times out. HikariCP lists 10 as the default maximum, but that is an implementation default, not a recommended size for every application. Check the HikariCP project documentation and the version used by your application framework.

More connections do not necessarily produce more throughput. Additional active transactions can help until the database’s resources are being used effectively; beyond that point, contention can make performance worse. A bounded pool can queue excess demand instead of sending every waiting request to the database at once.

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.
#1 Best Overall
VEVOR 9U Open Frame Server Rack, 23''-40'' Adjustable Depth, Free Standing or Wall Mount Network Server Rack, 4 Post AV Rack with Casters, Holds All Your Networking IT Equipment AV Gear Router Modem
  • Adjustable Depth: Depth adjustable from 23" to 40", this open frame server rack accommodates servers and network equipment while providing ample space for A/V gears and cable management. Enjoy easy access to ports and devices from multiple angles.
  • High Weight Capacity: Supports up to 300 lbs on the floor (200 lbs when adjusted to maximum depth) and 200 lbs when wall-mounted (depth cannot be adjusted in wall-mounted mode). Made from carbon steel for superior welding performance and durability, this open frame rack is designed to save space while accommodating multiple devices.
  • User-Friendly Design: Designed with your convenience in mind, this open frame server rack features an top shelf for extra storage and improved space utilization. The rolling casters let you move it effortlessly wherever you need it, making setup and movement a breeze.
  • Widely Applicable: Maximize your space with this adaptable open frame server rack, designed to make the most of every inch. Ideal for retail spots, classrooms, offices, and any area where space is at a premium, it delivers practical solutions for your storage needs.
  • Everything You Need: Our open-frame rack comes with fully equipped accessory kit for easy setup and secure installation: 2 x Trays, 4 x Casters, 1 x set of Screws, 16 x M6*12 Cage Nuts, 1 x Grounding Wire, 1 x Internal & External Hex Wrenches, and 1 x User Manual.

Build a connection budget for the whole deployment

Calculate the maximum connections that could be opened across the deployment, not just the limit in one process. A service with multiple replicas and possibly several pools per process can multiply a seemingly modest setting into a large server-wide demand.

  1. List every application instance and each pool it owns. Multiply the pool maximum by the number of instances.
  2. Add other connection consumers: worker services, scheduled jobs, monitoring, administrative sessions, and maintenance tools.
  3. Compare the total possible connections with the database’s configured limit, leaving room for operational use and unexpected demand.
  4. Check your deployed database version and, for a managed service, its platform-specific connection limits before changing the server cap.

In its PostgreSQL 17 documentation, the PostgreSQL Global Development Group says max_connections is typically 100 by default, subject to platform limits. It is a server-wide ceiling, not a pool-size recommendation. Raising it increases resource allocation, including shared memory, and requires a server restart. See the PostgreSQL 17 connection settings documentation.

Rank #2
VEVOR 12U Open Frame Server Rack, 23-40 in Adjustable Depth, Free Standing or Wall Mount Network Server Rack, 4 Post AV Rack with Casters, Holds All Your Networking IT Equipment AV Gear Router Modem
  • Adjustable Depth: 23-40'' adjustable depth is used for servers and network equipment, ensuring enough space for AV equipment, components, and cabling, while allowing you to access ports and equipment from multiple sides.
  • Strong Load Capacity: Ground-Mounted Load Capacity: 500 lbs, Wall-Mounted Load Capacity: 150 lbs. The av rack is made of carbon steel for better weldability performance and can help save space while meeting your need to place multiple devices.
  • User-friendly Design: Ergonomic design makes the open frame av rack easier to use. The additional top panel is able to place other items with more available space. Roller design moves anywhere and anytime, is convenient, and is more energy-saving.
  • Complete Accessories: We provide the accessories you need, including 2 x Pallets, 145 x M5*10 Cross Head Screws, 4 x Casters, 4 x M10*50 Expansion Screws,10 x M6*12 Cage Nuts, 1 x Grounding Wire, 1 x User Manual.
  • Wide Application: The server rack wall mount maximizes the use of available space, suitable for retail venues, classrooms, offices, and other places where space is limited.

Estimate useful concurrency, then test it

Start with the amount of concurrent database work your workload can usefully advance. The answer depends on factors such as CPU, storage, cache behavior, query mix, and how long transactions hold connections. Front-end user count is not a substitute: many users may not be querying at the same time, while a smaller group of busy workers may create high database concurrency.

A PostgreSQL Wiki page offers the rough starting heuristic connections ≈ (core_count × 2) + effective_spindle_count. The PostgreSQL Wiki connection guidance presents it as a starting point, not a rule. The HikariCP pool-sizing wiki also repeats it as a heuristic and notes uncertainty around SSDs. Treat it as one candidate test point, not a guaranteed optimum or a substitute for measurements.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
VEVOR 1U Server Rack Shelf, 4 PCS, 50 lbs Max Load-Bearing Vented Cantilever, Wall Mount or Rack Mount Shelf with Tray, 10 in Depth, Good Air Circulation for 19 Inch Cabinet Computer Network Equipment
  • Standard 1U Height: Get more space with our 1U server rack shelf—it comes in a set of 4! Ideal for 19-inch 4-post server racks, stacking routers, switches, firewalls, and other network gear. Easy storage and a neat setup in one simple solution
  • Heavy-Duty Construction: Crafted from premium Q235 carbon steel with a robust 0.06 in (1.5 mm) thickness, our network rack shelf can handle up to 50 lbs (22.68 kg) with ease. Say goodbye to wobbles and tilts—keeping everything in its place
  • Optimal Ventilation: Featuring a vented bottom design, our rack mount shelf effectively reduces equipment temperature, ensuring stable operation and lowering the risk of malfunctions. Keep your gear running smoothly for longer-lasting performance
  • Flexible Partitioning: Each shelf features a depth of 10 in (254 mm). Our server rack shelf helps you organize and optimize your rack space efficiently. Keep your equipment neatly separated to reduce clutter and minimize interference or collisions
  • Installation Made Easy: Everything you need for installation is included—screws and nuts are provided, making the process quick and hassle-free. Simply use a Phillips screwdriver, and you'll have your network rack shelf installed in no time
  1. Choose a conservative starting maximum that fits the deployment-wide budget.
  2. Load-test with representative queries, transaction durations, and traffic patterns. Vary concurrency around the starting point.
  3. Compare useful throughput and tail latency, such as p95 and p99 response times. Do not rely on average response time alone.
  4. Stop increasing the pool when additional concurrency no longer improves useful throughput or starts worsening latency or database contention.
  5. Repeat under realistic peak conditions and check that headroom remains for other clients and operational work.

No single numeric pool size is established as best for all databases and applications. A useful setting is the one that performs well for your workload while respecting the total connection budget.

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

Read pool and database metrics together

Pool metrics show whether callers are waiting for connections; database metrics help establish whether the pool is limiting work or protecting a database that is already busy. Track these signals during load tests and after deployment:

Rank #4
Sale
HPE ProLiant DL380 Gen10 2U Rack Server Bundle with Dual Xeon 6148 2.40 GHz, 256GB DDR4 Memory, 15.36TB Enterprise SSD Storage, RAID, Dual Power, iLO, Rail Kit (Renewed)
  • HPE ProLiant DL380 Gen10 2U Rack Server with Rail kit for Enterprise
  • Dual (2) Xeon Gold 6148 20-Core 2.40 GHz, 27.5MB, Up To 3.70 GHz Turbo
  • Memory: 256GB (8 x 32GB) DDR4 PC4-25600 3200MHz Unbuffered Memory
  • Storage: 15.36TB (4 x 3.84TB) Enterprise 2.5” SATA III 6Gb/s SSDs for Ultra Fast Storage
  • Hard drives and memory upgrades included separately, not installed, installation required.
  • Pool: active and idle connections, pending borrowers, acquisition wait time, and acquisition timeouts.
  • Database and workload: query latency, transaction duration, database CPU, and total server connections.
  • Application outcome: useful throughput and p95/p99 latency under representative traffic.

If borrowers wait while the database still has capacity, the pool limit may be too restrictive. If connections are checked out for a long time while queries or transactions are slow, increasing the pool may add contention rather than solve the underlying bottleneck. Investigate query performance and transaction duration alongside pool settings.

Account for long-running work and idle connections

A connection remains occupied for the time it is leased, so a long transaction reduces the capacity available to other work. Bound background-job concurrency so a burst of workers cannot consume the whole pool. If two workload classes have sharply different needs, separate pools may provide isolation, but only when that isolation justifies splitting the same finite database connection budget.

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

HikariCP’s minimumIdle controls the idle baseline and defaults to maximumPoolSize in its project documentation. HikariCP recommends allowing fixed-size behavior for maximum performance and responsiveness to spikes; verify the setting against your deployed version and framework. Regardless of the idle baseline, include each pool’s maximum—not just its usual active count—in the deployment-wide connection budget.

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 *

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.

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. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.