You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Phil Steitz <ph...@gmail.com> on 2011/05/13 22:17:46 UTC

[pool] numActive

I see this now in GOP javadoc for numActive.

 * The combined count of the currently active objects and those in the
     * process of being created. Under load, it may exceed {@link
#_maxActive}
     * but there will never be more than {@link #_maxActive} created
at any one
     * time.

[performance] still checks to make sure this does not happen and I
have not seen it yet in my load tests.  I don't personally like the
idea of allowing the number of instances being created + under
management to exceed maxActive.  This could cause resource problems
for systems that experience load spikes and if it is allowed "a
little" then on loaded systems that can quickly escalate to "a
lot".  I don't think we should back off of this invariant contract. 
Could be I am misunderstanding the comment and what it really means
to say is that numActive can overstate the instance count in certain
circumstances.  Is that what is meant?

Also, I think it would be great to change the name of this member
variable and the numActive property on the Deque in GKOP.  The name
is misleading as it is really idle + active + being created.  Maybe
something like instanceCount.

Phil

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


Re: [pool] numActive

Posted by ma...@apache.org.
Phil Steitz <ph...@gmail.com> wrote:

>I see this now in GOP javadoc for numActive.
>
> * The combined count of the currently active objects and those in the
>     * process of being created. Under load, it may exceed {@link
>#_maxActive}
>     * but there will never be more than {@link #_maxActive} created
>at any one
>     * time.
>
>[performance] still checks to make sure this does not happen and I
>have not seen it yet in my load tests.  I don't personally like the
>idea of allowing the number of instances being created + under
>management to exceed maxActive.  This could cause resource problems
>for systems that experience load spikes and if it is allowed "a
>little" then on loaded systems that can quickly escalate to "a
>lot".  I don't think we should back off of this invariant contract. 
>Could be I am misunderstanding the comment and what it really means
>to say is that numActive can overstate the instance count in certain
>circumstances.  Is that what is meant?
>
>Also, I think it would be great to change the name of this member
>variable and the numActive property on the Deque in GKOP.  The name
>is misleading as it is really idle + active + being created.  Maybe
>something like instanceCount.
>
>Phil
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>For additional commands, e-mail: dev-help@commons.apache.org

The naming could be better and there is probably a case for two attributes.

The short version is:
- there will never be more than maxActive objects created / in creation
- under load numActive may exceed maxActive for a very short time but it will be reduced again a few lines of code later before the object creation process starts.

There is actually a bunch of attribute renaming that needs to be done.

Mark



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