Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9SYH-0000GP-9x for pgsql-jdbc@arkaria.postgresql.org; Tue, 31 Oct 2017 09:09:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e9SYG-0004DQ-Sx for pgsql-jdbc@arkaria.postgresql.org; Tue, 31 Oct 2017 09:09:40 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e9SYG-0004Co-2v for pgsql-jdbc@postgresql.org; Tue, 31 Oct 2017 09:09:40 +0000 Received: from host3.dynacom.ondsl.gr ([62.103.35.211] helo=smadev.internal.net) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e9SY9-00071o-Ho for pgsql-jdbc@postgresql.org; Tue, 31 Oct 2017 09:09:38 +0000 Received: from smadev.internal.net (smadev [10.9.200.131]) by smadev.internal.net (8.15.2/8.15.2) with ESMTP id v9V98AqI025735; Tue, 31 Oct 2017 11:08:10 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) Subject: Re: Could pgsql jdbc support pool reauthentication? To: Vladimir Sitnikov Cc: List References: <74d59bcf-cc4f-3a61-cf0a-8ab3ed5ca9aa@matrix.gatewaynet.com> From: Achilleas Mantzios Message-ID: <09a677fd-144f-6b16-57a8-ed6a18f3ff08@matrix.gatewaynet.com> Date: Tue, 31 Oct 2017 11:08:10 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Hello Vladimir, thanx On 31/10/2017 10:30, Vladimir Sitnikov wrote: > Achilleas>So if say we need 5 connections max for the most complex app to work, and we have 200 users, then at peak time, the total number of connections would have to be raised to 1000. > > Pools can shrink, so you do not have to raise total number of connections to 1000 unless you truly expect 1000 concurrent connections. I know, but we still risk having our max_connections exceeded. And this is not scaleable. > > That is, you could configure 200 pools with minCapacity=0, maxCapacity=5. > Of course you would need thread-pool limits as well to avoid sending more than 5 concurrent requests on behalf of a given user id. > That's what he have done. > Technically speaking, there's JDBC standard way of calling "set_user" via java.sql.Connection#setClientInfo("ClientUser", java.lang.String), however I'm not sure how well it is supported/used. > > > PS Are you aware of ApplicationName? That is java.sql.Connection#setClientInfo("ApplicationName", java.lang.String) Yes, we make heavy use of ApplicationName in each of our apps/tenants. Pretty handy with logging, pgbadger etc. > > Vladimir -- Achilleas Mantzios IT DEV Lead IT DEPT Dynacom Tankers Mgmt -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc