[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tomcat-user
Subject:    Re: tomcat 7 connection pool validation interval
From:       Phil Steitz <phil.steitz () gmail ! com>
Date:       2016-06-30 15:56:41
Message-ID: B54DF588-059F-4A3A-AA99-E301FE57BE01 () gmail ! com
[Download RAW message or body]



> On Jun 30, 2016, at 9:32 AM, Nir Dweck <nird@vasco-de.com> wrote:
> 
> I am using tomcat connection  pool (tomcat 7) in my application (java application) \
> to connect to a remote Oracle DB on an Azure machine. My connection pool \
> configuration is as follow: 
> PoolProperties p = new PoolProperties();
> p.setUrl(connString);
> p.setUsername(user);
> p.setPassword(password);
> p.setDriverClassName("oracle.jdbc.OracleDriver");
> p.setValidationQuery("SELECT 1 from dual");
> p.setValidationInterval(1 * 60000/2);
> p.setTimeBetweenEvictionRunsMillis(1 * 60000/2);
> p.setTestOnBorrow(true);
> p.setTestWhileIdle(true);
> p.setMinIdle(10);
> p.setInitialSize(10);
> However looking at the capture file, I see that the connections are not checked \
> every 30 seconds as I expected. One connection is checked correctly, the others are \
> checked after 3 times the configuration (180 second). then again only some of the \
> connections are checked and after a while it seems to stable on twice the \
> configuration period (every 60 seconds). 
> I tested it with different configured time and different pool size, all had a \
> instability period in which each time only part of the connections were checked and \
> eventually it stabled on checks of all the connections every twice the configured \
> time. What am I missing?
> Thanks,

Most likely the connections not being tested are checked out to clients when the pool \
maintenance runs.  Assuming you are using the default DBCP pool, only idle \
connections (meaning waiting in the pool)  are tested by the maintenance thread.

Phil
> 
> Nir

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic