You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Phil Steitz <ph...@gmail.com> on 2010/06/19 18:45:31 UTC

[dbcp] Re: DBCP minIdle

mehul mehta wrote:
> 
> Hello, We have dbcp configuration in production set as minIdle = 25, maxIdle = 50, maxActive = 10000. We often experience slow down in queries to the database that normally do not take that long. We are pretty sure that it is not the database.Let us say the idle connections are 25. Now one of the idle connections is used up. Does dbcp create a new connection right away to maintain 25 idle connections. Or does dbcp wait for 25 idle connections to be used up and then create 25 new connections at one time? Regards,

The pool does not attempt to ensure minIdle after each
borrow/return. It does this each time the "evictor" maintenance
thread runs, which is once every timeBetweenEvictionRunsMillis
milliseconds.

maxIdle is enforced on each return to the pool - i.e., if there are
maxIdle connections idle in the pool when a connection is returned,
it is destroyed.

What versions of dbcp and pool are you running and what is your
timeBetweenEvictionRunsMillis setting?

Phil

> - Mehul 		 	   		  
> _________________________________________________________________
> See the news as it happens on MSN videos
> http://video.in.msn.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


RE: [dbcp] Re: DBCP minIdle

Posted by mehul mehta <ma...@hotmail.com>.
Thanks. We are using dbcp and pool that ship with tomcat (6.0.26) i.e. tomcat-dbcp.jar. I believe tomcat 6 uses dbcp 1.2.2 and pool 1.3. Here is the change log: http://tomcat.apache.org/tomcat-6.0-doc/changelog.html
- Mehul

> Date: Mon, 21 Jun 2010 08:06:08 -0400
> From: phil.steitz@gmail.com
> To: user@commons.apache.org
> Subject: Re: [dbcp] Re: DBCP minIdle
> 
> mehul mehta wrote:
> > So if we end up with 40 idle connections with a setting of 30 maxIdle
> 
> You will never have 40 idle connections if you set maxIdle at 30 -
> the excess idle connections will be destroyed when they are returned
> to the pool.
>  and 50 maxActive connections, does it mean that maxActive overrides
> maxIdle as far as idle connections are concerned
>  (evictor is off)?
> 
> MaxActive bounds the number of connections that can be either idle
> or active at any given time. If you have maxActive set at 50 and
> maxIdle set at 30, then you will never have more than 50 connections
> total opened by the pool and among these, no more than 30 will be
> idle at any time.
> 
> > Is there a way to log connection creation other than overriding BasicDataSource.getConnection?
> 
> No, DBCP does not log connection creation.  Most database engines
> provide a way to monitor this, though.
> 
> Also, not sure if there is a way to log how long the evictor runs?
> 
> No.
>  We are trying to see if application's poor performance is tied to
> the connection pool in any way.
> 
> It would help if you posted the versions of dbcp and pool that you
> are running and if you have not done so, upgrade to the latest versions.
> 
> Phil
> > - Mehul
> > 
> >> Date: Sun, 20 Jun 2010 08:24:44 -0400
> >> From: phil.steitz@gmail.com
> >> To: user@commons.apache.org
> >> Subject: Re: [dbcp] Re: DBCP minIdle
> >>
> >> mehul mehta wrote:
> >>> If we turn off the evictor, does it mean that the connections keep growing indefinitely in the pool?
> >> No.  The maxActive bound limits the total number of connections that
> >> can be either idle in the pool or checked out to clients at any
> >> given time.  (I would seriously consider reducing that value from
> >> where you have it set.)  The maxIdle setting, which works with or
> >> without the evictor, bounds the number of connections that can be
> >> idle in the pool.
> >>
> >> Phil
> >>>> Date: Sat, 19 Jun 2010 21:28:00 -0400
> >>>> From: phil.steitz@gmail.com
> >>>> To: user@commons.apache.org
> >>>> Subject: Re: [dbcp] Re: DBCP minIdle
> >>>>
> >>>> mehul mehta wrote:
> >>>>> Here is our config:
> >>>>>   maxActive="10000" maxWait="60000" minIdle="25" maxIdle="50" 
> >>>>>         validationQuery="select current_date from sysibm/sysdummy1" 
> >>>>>         testOnBorrow="true" 
> >>>>>         testWhileIdle="false" 
> >>>>>         testOnReturn="true" 
> >>>>>         timeBetweenEvictionRunsMillis="5000" 
> >>>>>         minEvictableIdleTimeMillis="60000" 
> >>>>>         numTestsPerEvictionRun="5" 
> >>>>>         removeAbandoned="true" 
> >>>>>         removeAbandonedTimeout="300" 
> >>>>>         logAbandoned="true"
> >>>>> It appears that our minEvictableIdleTimeMillis is too short. Probably, we should set it to the default which is 30 minutes.
> >>>>> Also, is there any down side of setting timeBetweenEvictionRunsMillis to -1 (no evictor)?
> >>>>> Not sure if you observe any thing else in the config that can cause performance issues?
> >>>> Yes, running the evictor every 5 seconds is likely to cause
> >>>> performance problems, especially during periods of heavy load or
> >>>> when using pool 1.3.
> >>>>
> >>>> If you turn off the evictor altogether, minIdle will not be
> >>>> maintained, there will be no abandoned connection removal, and no
> >>>> "eviction" of connections that have been idle in the pool for longer
> >>>> than the minEvictableIdleTimeMillis.  If your application does not
> >>>> need these things, you are better off turning off the evictor.
> >>>>
> >>>> Having maxActive so much larger than maxIdle could cause connection
> >>>> churn if load comes in spikes and you regularly go significantly
> >>>> above 50 active connections.
> >>>>
> >>>> Phil
> >>>>> - Mehul
> >>>>>
> >>>>>> Date: Sat, 19 Jun 2010 12:45:31 -0400
> >>>>>> From: phil.steitz@gmail.com
> >>>>>> To: user@commons.apache.org
> >>>>>> Subject: [dbcp] Re: DBCP minIdle
> >>>>>>
> >>>>>> mehul mehta wrote:
> >>>>>>> Hello, We have dbcp configuration in production set as minIdle = 25, maxIdle = 50, maxActive = 10000. We often experience slow down in queries to the database that normally do not take that long. We are pretty sure that it is not the database.Let us say the idle connections are 25. Now one of the idle connections is used up. Does dbcp create a new connection right away to maintain 25 idle connections. Or does dbcp wait for 25 idle connections to be used up and then create 25 new connections at one time? Regards,
> >>>>>> The pool does not attempt to ensure minIdle after each
> >>>>>> borrow/return. It does this each time the "evictor" maintenance
> >>>>>> thread runs, which is once every timeBetweenEvictionRunsMillis
> >>>>>> milliseconds.
> >>>>>>
> >>>>>> maxIdle is enforced on each return to the pool - i.e., if there are
> >>>>>> maxIdle connections idle in the pool when a connection is returned,
> >>>>>> it is destroyed.
> >>>>>>
> >>>>>> What versions of dbcp and pool are you running and what is your
> >>>>>> timeBetweenEvictionRunsMillis setting?
> >>>>>>
> >>>>>> Phil
> >>>>>>
> >>>>>>> - Mehul 		 	   		  
> >>>>>>> _________________________________________________________________
> >>>>>>> See the news as it happens on MSN videos
> >>>>>>> http://video.in.msn.com/
> >>>>>> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> >>>>>> For additional commands, e-mail: user-help@commons.apache.org
> >>>>>>
> >>>>>  		 	   		  
> >>>>> _________________________________________________________________
> >>>>> The latest in fashion and style in MSN Lifestyle
> >>>>> http://lifestyle.in.msn.com/
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> >>>> For additional commands, e-mail: user-help@commons.apache.org
> >>>>
> >>>  		 	   		  
> >>> _________________________________________________________________
> >>> Bollywood This Decade
> >>> http://entertainment.in.msn.com/bollywoodthisdecade/
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> >> For additional commands, e-mail: user-help@commons.apache.org
> >>
> >  		 	   		  
> > _________________________________________________________________
> > The world on four wheels in MSN Autos
> > http://autos.in.msn.com/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 
 		 	   		  
_________________________________________________________________
Bollywood This Decade
http://entertainment.in.msn.com/bollywoodthisdecade/

Re: [dbcp] Re: DBCP minIdle

Posted by Phil Steitz <ph...@gmail.com>.
mehul mehta wrote:
> So if we end up with 40 idle connections with a setting of 30 maxIdle

You will never have 40 idle connections if you set maxIdle at 30 -
the excess idle connections will be destroyed when they are returned
to the pool.
 and 50 maxActive connections, does it mean that maxActive overrides
maxIdle as far as idle connections are concerned
 (evictor is off)?

MaxActive bounds the number of connections that can be either idle
or active at any given time. If you have maxActive set at 50 and
maxIdle set at 30, then you will never have more than 50 connections
total opened by the pool and among these, no more than 30 will be
idle at any time.

> Is there a way to log connection creation other than overriding BasicDataSource.getConnection?

No, DBCP does not log connection creation.  Most database engines
provide a way to monitor this, though.

Also, not sure if there is a way to log how long the evictor runs?

No.
 We are trying to see if application's poor performance is tied to
the connection pool in any way.

It would help if you posted the versions of dbcp and pool that you
are running and if you have not done so, upgrade to the latest versions.

Phil
> - Mehul
> 
>> Date: Sun, 20 Jun 2010 08:24:44 -0400
>> From: phil.steitz@gmail.com
>> To: user@commons.apache.org
>> Subject: Re: [dbcp] Re: DBCP minIdle
>>
>> mehul mehta wrote:
>>> If we turn off the evictor, does it mean that the connections keep growing indefinitely in the pool?
>> No.  The maxActive bound limits the total number of connections that
>> can be either idle in the pool or checked out to clients at any
>> given time.  (I would seriously consider reducing that value from
>> where you have it set.)  The maxIdle setting, which works with or
>> without the evictor, bounds the number of connections that can be
>> idle in the pool.
>>
>> Phil
>>>> Date: Sat, 19 Jun 2010 21:28:00 -0400
>>>> From: phil.steitz@gmail.com
>>>> To: user@commons.apache.org
>>>> Subject: Re: [dbcp] Re: DBCP minIdle
>>>>
>>>> mehul mehta wrote:
>>>>> Here is our config:
>>>>>   maxActive="10000" maxWait="60000" minIdle="25" maxIdle="50" 
>>>>>         validationQuery="select current_date from sysibm/sysdummy1" 
>>>>>         testOnBorrow="true" 
>>>>>         testWhileIdle="false" 
>>>>>         testOnReturn="true" 
>>>>>         timeBetweenEvictionRunsMillis="5000" 
>>>>>         minEvictableIdleTimeMillis="60000" 
>>>>>         numTestsPerEvictionRun="5" 
>>>>>         removeAbandoned="true" 
>>>>>         removeAbandonedTimeout="300" 
>>>>>         logAbandoned="true"
>>>>> It appears that our minEvictableIdleTimeMillis is too short. Probably, we should set it to the default which is 30 minutes.
>>>>> Also, is there any down side of setting timeBetweenEvictionRunsMillis to -1 (no evictor)?
>>>>> Not sure if you observe any thing else in the config that can cause performance issues?
>>>> Yes, running the evictor every 5 seconds is likely to cause
>>>> performance problems, especially during periods of heavy load or
>>>> when using pool 1.3.
>>>>
>>>> If you turn off the evictor altogether, minIdle will not be
>>>> maintained, there will be no abandoned connection removal, and no
>>>> "eviction" of connections that have been idle in the pool for longer
>>>> than the minEvictableIdleTimeMillis.  If your application does not
>>>> need these things, you are better off turning off the evictor.
>>>>
>>>> Having maxActive so much larger than maxIdle could cause connection
>>>> churn if load comes in spikes and you regularly go significantly
>>>> above 50 active connections.
>>>>
>>>> Phil
>>>>> - Mehul
>>>>>
>>>>>> Date: Sat, 19 Jun 2010 12:45:31 -0400
>>>>>> From: phil.steitz@gmail.com
>>>>>> To: user@commons.apache.org
>>>>>> Subject: [dbcp] Re: DBCP minIdle
>>>>>>
>>>>>> mehul mehta wrote:
>>>>>>> Hello, We have dbcp configuration in production set as minIdle = 25, maxIdle = 50, maxActive = 10000. We often experience slow down in queries to the database that normally do not take that long. We are pretty sure that it is not the database.Let us say the idle connections are 25. Now one of the idle connections is used up. Does dbcp create a new connection right away to maintain 25 idle connections. Or does dbcp wait for 25 idle connections to be used up and then create 25 new connections at one time? Regards,
>>>>>> The pool does not attempt to ensure minIdle after each
>>>>>> borrow/return. It does this each time the "evictor" maintenance
>>>>>> thread runs, which is once every timeBetweenEvictionRunsMillis
>>>>>> milliseconds.
>>>>>>
>>>>>> maxIdle is enforced on each return to the pool - i.e., if there are
>>>>>> maxIdle connections idle in the pool when a connection is returned,
>>>>>> it is destroyed.
>>>>>>
>>>>>> What versions of dbcp and pool are you running and what is your
>>>>>> timeBetweenEvictionRunsMillis setting?
>>>>>>
>>>>>> Phil
>>>>>>
>>>>>>> - Mehul 		 	   		  
>>>>>>> _________________________________________________________________
>>>>>>> See the news as it happens on MSN videos
>>>>>>> http://video.in.msn.com/
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>>>
>>>>>  		 	   		  
>>>>> _________________________________________________________________
>>>>> The latest in fashion and style in MSN Lifestyle
>>>>> http://lifestyle.in.msn.com/
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>
>>>  		 	   		  
>>> _________________________________________________________________
>>> Bollywood This Decade
>>> http://entertainment.in.msn.com/bollywoodthisdecade/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>  		 	   		  
> _________________________________________________________________
> The world on four wheels in MSN Autos
> http://autos.in.msn.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


RE: [dbcp] Re: DBCP minIdle

Posted by mehul mehta <ma...@hotmail.com>.
So if we end up with 40 idle connections with a setting of 30 maxIdle and 50 maxActive connections, does it mean that maxActive overrides maxIdle as far as idle connections are concerned (evictor is off)?
We will reduce the maxActive setting as well as increase the timeBetweenEvictionRunsMillis at which the evictor runs. Is there a way to log connection creation other than overriding BasicDataSource.getConnection?Also, not sure if there is a way to log how long the evictor runs? We are trying to see if application's poor performance is tied to the connection pool in any way.
- Mehul

> Date: Sun, 20 Jun 2010 08:24:44 -0400
> From: phil.steitz@gmail.com
> To: user@commons.apache.org
> Subject: Re: [dbcp] Re: DBCP minIdle
> 
> mehul mehta wrote:
> > If we turn off the evictor, does it mean that the connections keep growing indefinitely in the pool?
> 
> No.  The maxActive bound limits the total number of connections that
> can be either idle in the pool or checked out to clients at any
> given time.  (I would seriously consider reducing that value from
> where you have it set.)  The maxIdle setting, which works with or
> without the evictor, bounds the number of connections that can be
> idle in the pool.
> 
> Phil
> > 
> >> Date: Sat, 19 Jun 2010 21:28:00 -0400
> >> From: phil.steitz@gmail.com
> >> To: user@commons.apache.org
> >> Subject: Re: [dbcp] Re: DBCP minIdle
> >>
> >> mehul mehta wrote:
> >>> Here is our config:
> >>>   maxActive="10000" maxWait="60000" minIdle="25" maxIdle="50" 
> >>>         validationQuery="select current_date from sysibm/sysdummy1" 
> >>>         testOnBorrow="true" 
> >>>         testWhileIdle="false" 
> >>>         testOnReturn="true" 
> >>>         timeBetweenEvictionRunsMillis="5000" 
> >>>         minEvictableIdleTimeMillis="60000" 
> >>>         numTestsPerEvictionRun="5" 
> >>>         removeAbandoned="true" 
> >>>         removeAbandonedTimeout="300" 
> >>>         logAbandoned="true"
> >>> It appears that our minEvictableIdleTimeMillis is too short. Probably, we should set it to the default which is 30 minutes.
> >>> Also, is there any down side of setting timeBetweenEvictionRunsMillis to -1 (no evictor)?
> >>> Not sure if you observe any thing else in the config that can cause performance issues?
> >> Yes, running the evictor every 5 seconds is likely to cause
> >> performance problems, especially during periods of heavy load or
> >> when using pool 1.3.
> >>
> >> If you turn off the evictor altogether, minIdle will not be
> >> maintained, there will be no abandoned connection removal, and no
> >> "eviction" of connections that have been idle in the pool for longer
> >> than the minEvictableIdleTimeMillis.  If your application does not
> >> need these things, you are better off turning off the evictor.
> >>
> >> Having maxActive so much larger than maxIdle could cause connection
> >> churn if load comes in spikes and you regularly go significantly
> >> above 50 active connections.
> >>
> >> Phil
> >>> - Mehul
> >>>
> >>>> Date: Sat, 19 Jun 2010 12:45:31 -0400
> >>>> From: phil.steitz@gmail.com
> >>>> To: user@commons.apache.org
> >>>> Subject: [dbcp] Re: DBCP minIdle
> >>>>
> >>>> mehul mehta wrote:
> >>>>> Hello, We have dbcp configuration in production set as minIdle = 25, maxIdle = 50, maxActive = 10000. We often experience slow down in queries to the database that normally do not take that long. We are pretty sure that it is not the database.Let us say the idle connections are 25. Now one of the idle connections is used up. Does dbcp create a new connection right away to maintain 25 idle connections. Or does dbcp wait for 25 idle connections to be used up and then create 25 new connections at one time? Regards,
> >>>> The pool does not attempt to ensure minIdle after each
> >>>> borrow/return. It does this each time the "evictor" maintenance
> >>>> thread runs, which is once every timeBetweenEvictionRunsMillis
> >>>> milliseconds.
> >>>>
> >>>> maxIdle is enforced on each return to the pool - i.e., if there are
> >>>> maxIdle connections idle in the pool when a connection is returned,
> >>>> it is destroyed.
> >>>>
> >>>> What versions of dbcp and pool are you running and what is your
> >>>> timeBetweenEvictionRunsMillis setting?
> >>>>
> >>>> Phil
> >>>>
> >>>>> - Mehul 		 	   		  
> >>>>> _________________________________________________________________
> >>>>> See the news as it happens on MSN videos
> >>>>> http://video.in.msn.com/
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> >>>> For additional commands, e-mail: user-help@commons.apache.org
> >>>>
> >>>  		 	   		  
> >>> _________________________________________________________________
> >>> The latest in fashion and style in MSN Lifestyle
> >>> http://lifestyle.in.msn.com/
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> >> For additional commands, e-mail: user-help@commons.apache.org
> >>
> >  		 	   		  
> > _________________________________________________________________
> > Bollywood This Decade
> > http://entertainment.in.msn.com/bollywoodthisdecade/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 
 		 	   		  
_________________________________________________________________
The world on four wheels in MSN Autos
http://autos.in.msn.com/

Re: [dbcp] Re: DBCP minIdle

Posted by Phil Steitz <ph...@gmail.com>.
mehul mehta wrote:
> If we turn off the evictor, does it mean that the connections keep growing indefinitely in the pool?

No.  The maxActive bound limits the total number of connections that
can be either idle in the pool or checked out to clients at any
given time.  (I would seriously consider reducing that value from
where you have it set.)  The maxIdle setting, which works with or
without the evictor, bounds the number of connections that can be
idle in the pool.

Phil
> 
>> Date: Sat, 19 Jun 2010 21:28:00 -0400
>> From: phil.steitz@gmail.com
>> To: user@commons.apache.org
>> Subject: Re: [dbcp] Re: DBCP minIdle
>>
>> mehul mehta wrote:
>>> Here is our config:
>>>   maxActive="10000" maxWait="60000" minIdle="25" maxIdle="50" 
>>>         validationQuery="select current_date from sysibm/sysdummy1" 
>>>         testOnBorrow="true" 
>>>         testWhileIdle="false" 
>>>         testOnReturn="true" 
>>>         timeBetweenEvictionRunsMillis="5000" 
>>>         minEvictableIdleTimeMillis="60000" 
>>>         numTestsPerEvictionRun="5" 
>>>         removeAbandoned="true" 
>>>         removeAbandonedTimeout="300" 
>>>         logAbandoned="true"
>>> It appears that our minEvictableIdleTimeMillis is too short. Probably, we should set it to the default which is 30 minutes.
>>> Also, is there any down side of setting timeBetweenEvictionRunsMillis to -1 (no evictor)?
>>> Not sure if you observe any thing else in the config that can cause performance issues?
>> Yes, running the evictor every 5 seconds is likely to cause
>> performance problems, especially during periods of heavy load or
>> when using pool 1.3.
>>
>> If you turn off the evictor altogether, minIdle will not be
>> maintained, there will be no abandoned connection removal, and no
>> "eviction" of connections that have been idle in the pool for longer
>> than the minEvictableIdleTimeMillis.  If your application does not
>> need these things, you are better off turning off the evictor.
>>
>> Having maxActive so much larger than maxIdle could cause connection
>> churn if load comes in spikes and you regularly go significantly
>> above 50 active connections.
>>
>> Phil
>>> - Mehul
>>>
>>>> Date: Sat, 19 Jun 2010 12:45:31 -0400
>>>> From: phil.steitz@gmail.com
>>>> To: user@commons.apache.org
>>>> Subject: [dbcp] Re: DBCP minIdle
>>>>
>>>> mehul mehta wrote:
>>>>> Hello, We have dbcp configuration in production set as minIdle = 25, maxIdle = 50, maxActive = 10000. We often experience slow down in queries to the database that normally do not take that long. We are pretty sure that it is not the database.Let us say the idle connections are 25. Now one of the idle connections is used up. Does dbcp create a new connection right away to maintain 25 idle connections. Or does dbcp wait for 25 idle connections to be used up and then create 25 new connections at one time? Regards,
>>>> The pool does not attempt to ensure minIdle after each
>>>> borrow/return. It does this each time the "evictor" maintenance
>>>> thread runs, which is once every timeBetweenEvictionRunsMillis
>>>> milliseconds.
>>>>
>>>> maxIdle is enforced on each return to the pool - i.e., if there are
>>>> maxIdle connections idle in the pool when a connection is returned,
>>>> it is destroyed.
>>>>
>>>> What versions of dbcp and pool are you running and what is your
>>>> timeBetweenEvictionRunsMillis setting?
>>>>
>>>> Phil
>>>>
>>>>> - Mehul 		 	   		  
>>>>> _________________________________________________________________
>>>>> See the news as it happens on MSN videos
>>>>> http://video.in.msn.com/
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>
>>>  		 	   		  
>>> _________________________________________________________________
>>> The latest in fashion and style in MSN Lifestyle
>>> http://lifestyle.in.msn.com/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>  		 	   		  
> _________________________________________________________________
> Bollywood This Decade
> http://entertainment.in.msn.com/bollywoodthisdecade/


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


RE: [dbcp] Re: DBCP minIdle

Posted by mehul mehta <ma...@hotmail.com>.
If we turn off the evictor, does it mean that the connections keep growing indefinitely in the pool?

> Date: Sat, 19 Jun 2010 21:28:00 -0400
> From: phil.steitz@gmail.com
> To: user@commons.apache.org
> Subject: Re: [dbcp] Re: DBCP minIdle
> 
> mehul mehta wrote:
> > Here is our config:
> >   maxActive="10000" maxWait="60000" minIdle="25" maxIdle="50" 
> >         validationQuery="select current_date from sysibm/sysdummy1" 
> >         testOnBorrow="true" 
> >         testWhileIdle="false" 
> >         testOnReturn="true" 
> >         timeBetweenEvictionRunsMillis="5000" 
> >         minEvictableIdleTimeMillis="60000" 
> >         numTestsPerEvictionRun="5" 
> >         removeAbandoned="true" 
> >         removeAbandonedTimeout="300" 
> >         logAbandoned="true"
> > It appears that our minEvictableIdleTimeMillis is too short. Probably, we should set it to the default which is 30 minutes.
> > Also, is there any down side of setting timeBetweenEvictionRunsMillis to -1 (no evictor)?
> > Not sure if you observe any thing else in the config that can cause performance issues?
> 
> Yes, running the evictor every 5 seconds is likely to cause
> performance problems, especially during periods of heavy load or
> when using pool 1.3.
> 
> If you turn off the evictor altogether, minIdle will not be
> maintained, there will be no abandoned connection removal, and no
> "eviction" of connections that have been idle in the pool for longer
> than the minEvictableIdleTimeMillis.  If your application does not
> need these things, you are better off turning off the evictor.
> 
> Having maxActive so much larger than maxIdle could cause connection
> churn if load comes in spikes and you regularly go significantly
> above 50 active connections.
> 
> Phil
> > - Mehul
> > 
> >> Date: Sat, 19 Jun 2010 12:45:31 -0400
> >> From: phil.steitz@gmail.com
> >> To: user@commons.apache.org
> >> Subject: [dbcp] Re: DBCP minIdle
> >>
> >> mehul mehta wrote:
> >>> Hello, We have dbcp configuration in production set as minIdle = 25, maxIdle = 50, maxActive = 10000. We often experience slow down in queries to the database that normally do not take that long. We are pretty sure that it is not the database.Let us say the idle connections are 25. Now one of the idle connections is used up. Does dbcp create a new connection right away to maintain 25 idle connections. Or does dbcp wait for 25 idle connections to be used up and then create 25 new connections at one time? Regards,
> >> The pool does not attempt to ensure minIdle after each
> >> borrow/return. It does this each time the "evictor" maintenance
> >> thread runs, which is once every timeBetweenEvictionRunsMillis
> >> milliseconds.
> >>
> >> maxIdle is enforced on each return to the pool - i.e., if there are
> >> maxIdle connections idle in the pool when a connection is returned,
> >> it is destroyed.
> >>
> >> What versions of dbcp and pool are you running and what is your
> >> timeBetweenEvictionRunsMillis setting?
> >>
> >> Phil
> >>
> >>> - Mehul 		 	   		  
> >>> _________________________________________________________________
> >>> See the news as it happens on MSN videos
> >>> http://video.in.msn.com/
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> >> For additional commands, e-mail: user-help@commons.apache.org
> >>
> >  		 	   		  
> > _________________________________________________________________
> > The latest in fashion and style in MSN Lifestyle
> > http://lifestyle.in.msn.com/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 
 		 	   		  
_________________________________________________________________
Bollywood This Decade
http://entertainment.in.msn.com/bollywoodthisdecade/

Re: [dbcp] Re: DBCP minIdle

Posted by Phil Steitz <ph...@gmail.com>.
mehul mehta wrote:
> Here is our config:
>   maxActive="10000" maxWait="60000" minIdle="25" maxIdle="50" 
>         validationQuery="select current_date from sysibm/sysdummy1" 
>         testOnBorrow="true" 
>         testWhileIdle="false" 
>         testOnReturn="true" 
>         timeBetweenEvictionRunsMillis="5000" 
>         minEvictableIdleTimeMillis="60000" 
>         numTestsPerEvictionRun="5" 
>         removeAbandoned="true" 
>         removeAbandonedTimeout="300" 
>         logAbandoned="true"
> It appears that our minEvictableIdleTimeMillis is too short. Probably, we should set it to the default which is 30 minutes.
> Also, is there any down side of setting timeBetweenEvictionRunsMillis to -1 (no evictor)?
> Not sure if you observe any thing else in the config that can cause performance issues?

Yes, running the evictor every 5 seconds is likely to cause
performance problems, especially during periods of heavy load or
when using pool 1.3.

If you turn off the evictor altogether, minIdle will not be
maintained, there will be no abandoned connection removal, and no
"eviction" of connections that have been idle in the pool for longer
than the minEvictableIdleTimeMillis.  If your application does not
need these things, you are better off turning off the evictor.

Having maxActive so much larger than maxIdle could cause connection
churn if load comes in spikes and you regularly go significantly
above 50 active connections.

Phil
> - Mehul
> 
>> Date: Sat, 19 Jun 2010 12:45:31 -0400
>> From: phil.steitz@gmail.com
>> To: user@commons.apache.org
>> Subject: [dbcp] Re: DBCP minIdle
>>
>> mehul mehta wrote:
>>> Hello, We have dbcp configuration in production set as minIdle = 25, maxIdle = 50, maxActive = 10000. We often experience slow down in queries to the database that normally do not take that long. We are pretty sure that it is not the database.Let us say the idle connections are 25. Now one of the idle connections is used up. Does dbcp create a new connection right away to maintain 25 idle connections. Or does dbcp wait for 25 idle connections to be used up and then create 25 new connections at one time? Regards,
>> The pool does not attempt to ensure minIdle after each
>> borrow/return. It does this each time the "evictor" maintenance
>> thread runs, which is once every timeBetweenEvictionRunsMillis
>> milliseconds.
>>
>> maxIdle is enforced on each return to the pool - i.e., if there are
>> maxIdle connections idle in the pool when a connection is returned,
>> it is destroyed.
>>
>> What versions of dbcp and pool are you running and what is your
>> timeBetweenEvictionRunsMillis setting?
>>
>> Phil
>>
>>> - Mehul 		 	   		  
>>> _________________________________________________________________
>>> See the news as it happens on MSN videos
>>> http://video.in.msn.com/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>  		 	   		  
> _________________________________________________________________
> The latest in fashion and style in MSN Lifestyle
> http://lifestyle.in.msn.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


RE: [dbcp] Re: DBCP minIdle

Posted by mehul mehta <ma...@hotmail.com>.
Here is our config:
  maxActive="10000" maxWait="60000" minIdle="25" maxIdle="50" 
        validationQuery="select current_date from sysibm/sysdummy1" 
        testOnBorrow="true" 
        testWhileIdle="false" 
        testOnReturn="true" 
        timeBetweenEvictionRunsMillis="5000" 
        minEvictableIdleTimeMillis="60000" 
        numTestsPerEvictionRun="5" 
        removeAbandoned="true" 
        removeAbandonedTimeout="300" 
        logAbandoned="true"
It appears that our minEvictableIdleTimeMillis is too short. Probably, we should set it to the default which is 30 minutes.
Also, is there any down side of setting timeBetweenEvictionRunsMillis to -1 (no evictor)?
Not sure if you observe any thing else in the config that can cause performance issues?
Thanks,
- Mehul

> Date: Sat, 19 Jun 2010 12:45:31 -0400
> From: phil.steitz@gmail.com
> To: user@commons.apache.org
> Subject: [dbcp] Re: DBCP minIdle
> 
> mehul mehta wrote:
> > 
> > Hello, We have dbcp configuration in production set as minIdle = 25, maxIdle = 50, maxActive = 10000. We often experience slow down in queries to the database that normally do not take that long. We are pretty sure that it is not the database.Let us say the idle connections are 25. Now one of the idle connections is used up. Does dbcp create a new connection right away to maintain 25 idle connections. Or does dbcp wait for 25 idle connections to be used up and then create 25 new connections at one time? Regards,
> 
> The pool does not attempt to ensure minIdle after each
> borrow/return. It does this each time the "evictor" maintenance
> thread runs, which is once every timeBetweenEvictionRunsMillis
> milliseconds.
> 
> maxIdle is enforced on each return to the pool - i.e., if there are
> maxIdle connections idle in the pool when a connection is returned,
> it is destroyed.
> 
> What versions of dbcp and pool are you running and what is your
> timeBetweenEvictionRunsMillis setting?
> 
> Phil
> 
> > - Mehul 		 	   		  
> > _________________________________________________________________
> > See the news as it happens on MSN videos
> > http://video.in.msn.com/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 
 		 	   		  
_________________________________________________________________
The latest in fashion and style in MSN Lifestyle
http://lifestyle.in.msn.com/