Question

Is a connection to pgbouncer cheaper than a connection to PostgreSQL (assuming pgbouncer has already established a connection to PostgreSQL) ? How is the connection to pgbouncer made ? I found the documentation a bit unclear.

Was it helpful?

Solution

PgBouncer speaks the normal PostgreSQL protocol. So a client application connects to PgBouncer normally, except by specifying the host and port where PgBouncer runs instead of the host and port where the PostgreSQL server runs. (The default port of PgBouncer is 6432.)

If PgBouncer has already established connections to the PostgreSQL backend, then opening a new connection from the client to PgBouncer is very fast. That is one of several reasons to use PgBouncer.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top