BUG #13825: JDBC Driver Connection Pool Issue
От | mayan.murad@kronos.com |
---|---|
Тема | BUG #13825: JDBC Driver Connection Pool Issue |
Дата | |
Msg-id | 20151217211707.3356.32260@wrigleys.postgresql.org обсуждение исходный текст |
Список | pgsql-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.
В списке pgsql-bugs по дате отправления: