Skip to content
Wade Womersley

wade.one

wade womersley – york based software engineer

  • Home
  • 2026
  • November
  • 20
  • Database Connection Pools Need a Budget Across Every Instance

Database Connection Pools Need a Budget Across Every Instance

Posted on November 20, 2026 By
Programming

A database pool with a maximum of ten connections sounds fairly restrained. Put it in twenty application instances and the application can now ask for 200 connections. Add workers, migration tooling and a rolling deployment with old and new instances running together, and the little setting in the application config starts looking rather more consequential.

PostgreSQL’s connection settings define a server-wide connection limit, with reserved slots for particular roles and emergency access. Raising that limit also increases some resource allocations. I would work backwards from what the database can support and the capacity the service actually needs, rather than treating a larger number as a free performance improvement.

Count pools per process, not just per deployment. A web server with several worker processes may create several pools inside one instance. Include the maximum intended instance count and the temporary overlap during a rollout. A pool limit is a ceiling rather than a promise that every connection is always open, but all those ceilings still matter when load arrives together. Leave deliberate room for operational access and the other clients sharing the server.

Then measure waiting as well as connections. Requests can spend their time waiting to borrow a connection even when individual queries look quick. Set a bounded wait that fits the request’s deadline, check that connections are returned after failures and inspect how long transactions hold them. A slow external call inside a transaction can keep a scarce connection occupied while the database has nothing useful to do. I would load-test the intended deployment size and watch pool wait time alongside database behaviour before deciding that the answer is more connections.

Share:

  • Share on Facebook (Opens in new window) Facebook
  • Share on X (Opens in new window) X
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit

Related

Comments

comments

Tags: connection-pooling postgresql scaling

Post navigation

❮ Previous Post: A Health Check Should Explain Whether Restarting Will Help

You may also like

Programming
MySQL and Binary(16) – The Reasons/Benefits/Drawbacks (#mysql)
January 31, 2010
AI
ChatGPT 5.5 and Codex Feel Like a Real Step Up
April 24, 2026
Programming
A Database Constraint Can Close the Gap Between Checking and Writing
October 29, 2026
Programming
I Trust Boring Infrastructure More Than Clever Infrastructure
April 4, 2026
  • AI
  • artificial intelligence
  • Ego-centric
  • Events
  • Films
  • Food
  • Gaming
  • Gym
  • Hardware
  • Holidays
  • News
  • PHP
  • Programming
  • Random Stuff
  • Reviews
  • Science
  • SEO
  • Software
  • Software Engineer
  • Support
  • Uncategorized
  • Work

Copyright © 2026 wade.one.

Theme: Oceanly News Dark by ScriptsTown