Many app instances open too many PostgreSQL connections. What helps most?
Why C is the answer
Connection pooling
Pooling reuses connections, which lowers overhead and improves throughput.
In detail
- Pooling reuses a small set of connections.
- Use the pooling option your service provides.
Use case
An illustrative scenario, not a real incident.
Hundreds of app instances exhaust PostgreSQL connections. A connection pool shares a small number among them.
See it in different ways
stateDiagram-v2 [*] --> SequentialScan: no vector index SequentialScan --> AddIndex: slow on large tables AddIndex --> ApproximateSearch: HNSW ApproximateSearch --> ReviewResources: memory is short ReviewResources --> ApproximateSearch
sequenceDiagram participant P0 as App instances participant P1 as Connection pool participant P2 as PostgreSQL P0->>P1: Many requests P1->>P2: Few connections P2-->>P0: Results
Key point: Pooling reuses connections.
Why the other options are wrong
- A. Removing all of the indexes on the table
- Removing indexes slows queries.
- B. Opening a new connection for every statement
- That is the behavior causing the problem.
- D. A larger disk
- A larger disk does not reduce connections.

