What's the recommendation for connection pooling? #730
Replies: 1 comment 2 replies
|
The practical recommendation is still to put A reactive driver removes blocking threads; it does not make PostgreSQL connections free. Each physical connection still has a TCP/TLS/authentication startup cost and consumes a PostgreSQL backend process. A bounded pool also gives you the second property you want: a hard per-node concurrency limit.
For raw R2DBC, the shortest configuration is for example: or build a Size it from the database budget, not from request concurrency. A useful upper bound is approximately: Then reduce it if load tests show that more concurrent queries only increase latency. Set a finite If the database is already behind PgBouncer, you can use a smaller application pool, but I would not normally create a new physical R2DBC connection for every operation. Also check transaction-pooling compatibility before relying on session state or connection-scoped prepared statements. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What's the recommendation for connection pooling?
Sometimes, we pool db connections, because they were expensive to create (slow).
Sometimes we want to control the maximum number of connections from each node to a server with limited connections available.
Thanks for any insights and suggestions!
All reactions