Django does not have built-in connection pooling. Why is this a problem for high-concurrency applications, and what architectural solutions like PgBouncer are typically used?
Last updated
Without pooling, each worker holds its own connection, and Postgres spawns a process per connection. High concurrency exhausts memory and hits
max_connections.CONN_MAX_AGEonly keeps a per-worker persistent connection. It neither shares connections across workers nor caps the total.An external pooler like PgBouncer multiplexes many app connections onto a small backend pool. Transaction mode breaks server-side prepared statements and session state.