Databases

Connection Pooling at Scale: Lessons From a Bad Migration

A connection pool sized for yesterday's traffic is an outage waiting for tomorrow's.

Connection pool sizing is one of those settings that gets configured once, during initial setup, and then never revisited until it causes an incident under a traffic pattern nobody anticipated.

The failure pattern

A pool sized correctly for average load starves under a traffic spike, queuing connections instead of rejecting them quickly — which turns a brief spike into a cascading timeout across every service sharing that database.

  • Fail fast on pool exhaustion rather than queuing indefinitely; a fast, clear error beats a slow cascade.
  • Size pools per-service based on actual concurrent query counts, not developer intuition.
  • A connection multiplexer in front of the database changes the sizing math entirely — measure before and after separately.

What to check this week

Graph pool utilization against your last three traffic spikes. If utilization pinned at 100% during any of them, the incident you have not had yet is already scheduled.

O

octetstack@gmail.com

Writes on octetstack.com about the systems work behind everything that scales.

Leave a comment

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