Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1yrk-00069h-1c for pgsql-general@arkaria.postgresql.org; Thu, 07 Mar 2019 19:39:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h1yri-0004o8-LL for pgsql-general@arkaria.postgresql.org; Thu, 07 Mar 2019 19:39:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1yri-0004mj-BO for pgsql-general@lists.postgresql.org; Thu, 07 Mar 2019 19:39:38 +0000 Received: from evolu-s.it ([94.23.66.144] helo=smtp.evolu-s.it) by magus.postgresql.org with smtp (Exim 4.89) (envelope-from ) id 1h1yre-00089A-FY for pgsql-general@lists.postgresql.org; Thu, 07 Mar 2019 19:39:37 +0000 Received: from [192.168.1.163] ([79.6.30.247]) by smtp.evolu-s.it ; Thu, 7 Mar 2019 20:39:31 +0100 Subject: Re: Connection pooling for differing databases? To: pgsql-general@lists.postgresql.org References: From: Moreno Andreo Message-ID: <877c818f-1902-ebb7-e882-c7689627a08b@evolu-s.it> Date: Thu, 7 Mar 2019 20:39:34 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: it List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Il 07/03/2019 20:27, Arjun Ranade ha scritto: > Hi all, > > I'm wondering if there's a tool like pgpool that can provide a single > origin point (host/port) that will proxy/direct connections to the > specific servers that contain the db needing to be accessed. Yes, I think there are many, but I'm encouraging you to take a look at pgbouncer https://pgbouncer.github.io/ in pgbouncer.ini you enter database configuration values like database = host=hostname port=xyzk, like mydb1 = host=cluster1 port=6543 or mydb2 = host=cluster1 port=9876 mydb3 = host=cluster2 port=6543 but there many other parameters to refine your config (like "proxying" database names, so if you share names across clusters you can easily avoid conflicts) Pgbouncer should be installed on the same server as the databases or in another and listens on a different port than Postgres' (say 5431 while postgres is on 5432) I'm actively using in my environment with 2 clusters and about 500 databases, works flawlessly. One thing you have to consider, if under heavy workload (say 100's of connections) is to raise kernel value of maximum open files Cheers Moreno.-