Pick the fix
After scaling to 40 pods, Postgres hits 'too many clients' and latency rises. Best fix?
Hint 1 of 1
Multiply pods by pool size.
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A Put PgBouncer in transaction mode in front and shrink per-pod pools
Correct. Thousands of client connections share a small server pool; total server connections stay bounded.
Each Postgres connection is a server process, and 40 pods × their pools exceed what it can serve well. PgBouncer in transaction mode lends a few server connections to many clients, one transaction at a time.
Why not the others?
- B Raise max_connections to 4,000. Each connection is a process; contention gets worse.
- C Open a new connection per query. Connection setup is expensive and still unbounded.
- D Add a read replica. Doesn't fix connection count on the primary for writes.