From: mayan.murad@kronos.com
To: pgsql-bugs@postgresql.org
Subject: BUG #13825: JDBC Driver Connection Pool Issue
Date: Thu, 17 Dec 2015 21:17:07 +0000
Message-ID: <20151217211707.3356.32260@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 13825
Logged by: Mayan Murad
Email address: mayan.murad@kronos.com
PostgreSQL version: 9.4.1
Operating system: RHEL
Description:
I have an environment where a Tomcat Application server is configured for a
Tomcat JDBC connection pool that uses the PostgreSQL JDBC driver,
specifically, postgresql-9.4-1206-jdbc42.jar.
My JDBC connection information is as follows:
<Resource name="jdbc/postgres" auth="Container"
type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://Node1:5444,Node2:5444,Node3:5444/edb?targetServerType=master"
username="enterprisedb" password=“hidden" initialSize="10" maxTotal="20"
maxIdle="10" minIdle="10" maxWaitMillis="-1"/>
Notice that I have 3 nodes and that I want the initial number of pooled
connections to be 10. After starting up Tomcat, I check pg_stat_activity to
see my connections that were established to the Master node. To my
surprise, I saw 30 connections! I then reduced the number of nodes in my
JDBC URL and I still saw 30 connections, even with just one node in the JDBC
URL.
Next, I reduced the value for initialSize and the pattern remained
consistent. I would always see 3 times the number of connections specified
in initialSize. I have a 3 node cluster as well, so I'm not sure if is
somehow getting the multiple from there.
We are going to have several Application Servers and don't want to incur
cost of creating connection to the database as users request them, so we
will definitely have some connection made at startup using the initialSize
parameter. This could dramatically increase the number of connections made
to the database.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: mayan.murad@kronos.com
Subject: Re: BUG #13825: JDBC Driver Connection Pool Issue
In-Reply-To: <20151217211707.3356.32260@wrigleys.postgresql.org>
References: <20151217211707.3356.32260@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox