logoalt Hacker News

aobdevtoday at 2:47 PM1 replyview on HN

Every single connection to Postgres is a new process, which requires a fork and new memory allocation (at least 10MB plus whatever you need for your query).

PgBouncer opens a pool of connections and then reuses them each time a client asks for a connection. This reduces latency (no more fork) and overhead (reuse memory).


Replies

gkbrktoday at 3:01 PM

If it's designed well, your application also opens a pool of connections and re-uses them each time the code needs a DB connection.

show 2 replies