13

Since in this mode pgbouncer creates outbound connection for each inbound connection it seems to me that pgbouncer doesn't work as pooler. It's just 1 to 1 mapping.

Where am I wrong?

1 Answer 1

22

There would be 1 connection to the server for each connection to pgbouncer, but not necessarily a new connection. When a connection to pgbouncer is closed it doesn't close the connection to the server, just makes that connection available to the pool. Then when a new connection comes in, that pooled connection can be reused.

If the connections to pgbouncer are generally long-lived ones, this might not be of much benefit. But, if there are a lot of short connections, it could result in a major improvement.

There was an excellect blog post published recently about pgbouncer, and the different modes of operation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.