Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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