Is this pgbouncer configuration suitable for a production environment with hundreds of databases?

From: Lisandro <rostagnolisandro(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Is this pgbouncer configuration suitable for a production environment with hundreds of databases?
Date: 2017-04-05 22:29:03
Message-ID: 1491431343023-5954479.post@n3.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi there!

I'm using pgbouncer in front of a PostgreSQL 9.3 instance.
I have hundreds of databases (almost 200 and counting).
The clients connect to pgbouncer always with the same user (there is one
only user).

Currently I have *postgresql max_connections=200*.
My pgbouncer configuration is this (I put only the directives regarding my
question):

[pgbouncer]
pool_mode = transaction
max_client_conn = 10000
default_pool_size = 2
min_pool_size = 0
reserve_pool_size = 2
reserve_pool_timeout = 5
max_db_connections = 5
server_idle_timeout = 30

[databases]
db1 = host=localhost port=6543 dbname=db1
db2...
db3...

Notice that I don't set a pool_size for every database, but instead I use
the general default_pool_size.

Our project is growing, and we are constantly adding new databases, so it's
a matter of time that we reach the number of 300 or 400 databases. Most of
the databases have low activity (websites with very few traffic).

So, considering that we have set postgresql max_connections=200, then
(correct me if I'm wrong) we would be reaching the postgresql limit of
max_connections soon.

The question is: can I set default_pool_size=0 to avoid reaching the
postgres limit? Is that suitable?
*My goal is to find a pgbouncer configuration that allows me to add
databases without worring about reaching the postgresql max_connection=200
limit. How can I achieve that?*

Thanks in advance!
Regards,
Lisandro.

--
View this message in context: http://www.postgresql-archive.org/Is-this-pgbouncer-configuration-suitable-for-a-production-environment-with-hundreds-of-databases-tp5954479.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2017-04-05 22:57:26 Re: Is this pgbouncer configuration suitable for a production environment with hundreds of databases?
Previous Message David G. Johnston 2017-04-05 21:44:55 Re: browser interface to forums please?