commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sandy McArthur" <>
Subject Re: Order of maintenance of pool
Date Thu, 15 Feb 2007 03:52:14 GMT
On 2/14/07, Sharma, Siddharth <> wrote:
> I changed the code to set
> genericConfig.softMinEvictableIdleTimeMillis=30000;
> instead of
> genericConfig.minEvictableIdleTimeMillis=30000;
> But it behaves exactly the same way. It does not maintain the min-idle
> threshold.

Hrm, could be a bug. See what happens when you don't use the Config
object and set that parameter on the GOP instance directly. I think I
recall squishing a Config bug or two related to it months ago.

> Should I be setting both values?

No, set minEvictableIdleTimeMillis to a time that disables it if you can.

> On another note: is 30 seconds too low or too high an idle eviction time? I
> realize it is application specific but I am trying to get a sense of what
> people are usually setting these values.

Depends, but probably too low. The lower the value the more work are
making the server do.

I've pooled connections to a custom service that had a 10 second idle
timeout. In that case 10 second idle eviction time would make sense.

I try to avoid use of a minIdle unless poolable object creation is
unbearably slow.

I avoid a maxIdle too. In the off chance during heavy load the thread
scheduler causes all 25 threads to all return borrowed objects at once
and you then need 25 objects again the next moment, with a maxIdle of
10 you've just discarded 15 perfectly good objects you could reuse.

Unless your poolable objects are insanely expensive to create and use
gobs of resources by simply existing then provided you can reliably
test-on-borrow, then the best performing pool would be one with no
maxIdle, no minIdle, no idle eviction, test-on-borrow enabled,
test-on-return disabled.

Gotta remember, a pool helps you reuse expensive, heavyweight objects.
Any setting that prematurely discards expensive objects is just going
to cost you when you need another object to work with.

Sandy McArthur

"He who dares not offend cannot be honest."
- Thomas Paine

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message