Menu
Back to Discussions

Connection pooling at scale: managing 10K+ database connections

Managing database connection pools at scale is one of those things that sounds simple until you actually have to do it. We have over 200 microservices, and each of them maintains its own connection pool to various databases, including a substantial PostgreSQL fleet. As our service count grew, we started hitting `max_connections` limits on our PostgreSQL instances more frequently, leading to application errors. Our initial fix was to reduce the size of individual service connection pools, but that felt like a band-aid. We then started exploring PgBouncer to centralize connection pooling and multiplex connections, which has helped significantly. However, even with PgBouncer, the sheer number of services and their dynamic scaling behavior still presents challenges. We're also slowly migrating some workloads to DynamoDB to reduce our relational DB dependency. I'm curious how other organizations with a large microservice footprint manage this. Are there better strategies than PgBouncer or just shifting to managed NoSQL services where connection management is less of a concern?
0 comments

Comments

Sign in to join the conversation.

Loading comments...