We have a multi tenant set up with one database for each tenant in a single server. Is it possible to main a common pool for all databases with pgbouncer? Our number databases in one server can range in a few hundreds. While I can have a large number of connections from application to pgbouncer, I am limited by the number of connection I can have with postgres server. What is the best approach in this scenario?
Asked
Active
Viewed 2,953 times
8
-
in what way are you limited by the number of connections to the postgres server? – Neil McGuigan Feb 14 '16 at 21:19
-
thanks for your response. There is max connection setting in pg_hba conf, and each connection takes huge memory - roughly about 4 mb. – Raj Feb 17 '16 at 13:31
-
1Hi, did you manage to setup pgBouncer to have same connection pooling settings for all databases ? – khorvat Dec 05 '16 at 09:30
-
Hello. What approach have you finally chosen in the end? I have similar situation, and also hit connection limits of postgres. One solution I see is to create schema per tenant, not database. But it seems there will be some drawbacks with backups, logging, etc. – struhtanov Jan 24 '19 at 13:31
-
According to https://dba.stackexchange.com/questions/36724/does-pgbouncer-create-a-separate-pool-for-every-database-config-entry it does not seem to be the case. – Jakub Holý Oct 08 '21 at 07:52