Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a rule or something I can use to calculate a good number for max_connections, default_pool_size and max_client_conn?

The defaults are odd. PostgreSQL defaults to max_connections=100 while pgboucner defaults to default_pool_size=20. Shouldn't default_pool_size always be higher than max_connections? Otherwise, what's the point? I thought pgbouncer was meant to let us handle more connections by lowering their overhead (by reusing PostgreSQL's connections). I'm confused.

I'm looking for advice similar to the ones found in PostgreSQL's wiki, like "this parameter should be ~50% of your memory".

I also remember there was a spreadsheet for MySQL that would let you calculate these kind of parameters. It would be awesome to have something like that for PostgreSQL/pgbouncer.

share|improve this question

default_pool_size should always be less than max_client_conn. max_client_connection is the number of socket connections between the application and pgbuffer. default_pool_size is the number of connections between pgbuffer and the db.

So if you are using transaction as your pool mode you can share the smaller default_pool_size with the larger number of clients.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .