You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Rohit Kelapure <ke...@gmail.com> on 2011/10/26 04:13:07 UTC
Executor threadRenewalDelay questions
Dear All,
After going through the thread renewal code in
/tomcat-8.0.x/java/org/apache/tomcat/util/threads/TaskQueue.java ,
/tomcat-8.0.x/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
and the bug (Improve ThreadLocal memory leak clean-up)
https://issues.apache.org/bugzilla/show_bug.cgi?id=49159 I had the
following questions-
1. Once the thread pool has been renewed after No. of active threads
in pool * max (threadKeepAliveTimeout, longestRequest+
threadRenewalDelay) seconds, why does the ThreadPoolExecutor still
keep paying the price of thread renewal. ?
After org.apache.tomcat.util.threads.ThreadPoolExecutor.threadRenewalDelay
is set to 1000L it never goes back to -1. Ideally once the all the
threads in the threadpool is renewed we should revert the
threadRenewalDelay back to -1 and NOT call
ThreadPoolExecutor.currentThreadShouldBeStopped()/ThreadPoolExecutor.stopCurrentThreadIfNeeded()
in TaskQueue.poll(long, TimeUnit) or TaskQueue.take().
Is this because we are never quite sure as to when *all* of the
threads in the pool have been renewed ?
2. Does the thread renewal approach scale under load (i.e. all threads
in the pool busy servicing requests and CPU close to 90%) ? Is it
meant for production deployments ?
3. How about threads that are servicing long running HTTP Keep-alive
connections that never let the thread return to the pool. Are these
threads renewed before the server is stopped.
--Thanks,
Rohit Kelapure
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: Executor threadRenewalDelay questions
Posted by Rohit Kelapure <ke...@gmail.com>.
Sorry. Will post there.
--cheers,
Rohit
On Wed, Oct 26, 2011 at 11:21 AM, Mark Thomas <ma...@apache.org> wrote:
> On 26/10/2011 03:13, Rohit Kelapure wrote:
>> Dear All,
>>
>> After going through the thread renewal code in
>> /tomcat-8.0.x/java/org/apache/tomcat/util/threads/TaskQueue.java ,
>> /tomcat-8.0.x/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
>> and the bug (Improve ThreadLocal memory leak clean-up)
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=49159 I had the
>> following questions-
>>
>> 1. Once the thread pool has been renewed after No. of active threads
>> in pool * max (threadKeepAliveTimeout, longestRequest+
>> threadRenewalDelay) seconds, why does the ThreadPoolExecutor still
>> keep paying the price of thread renewal. ?
>>
>> After org.apache.tomcat.util.threads.ThreadPoolExecutor.threadRenewalDelay
>> is set to 1000L it never goes back to -1. Ideally once the all the
>> threads in the threadpool is renewed we should revert the
>> threadRenewalDelay back to -1 and NOT call
>> ThreadPoolExecutor.currentThreadShouldBeStopped()/ThreadPoolExecutor.stopCurrentThreadIfNeeded()
>> in TaskQueue.poll(long, TimeUnit) or TaskQueue.take().
>> Is this because we are never quite sure as to when *all* of the
>> threads in the pool have been renewed ?
>>
>> 2. Does the thread renewal approach scale under load (i.e. all threads
>> in the pool busy servicing requests and CPU close to 90%) ? Is it
>> meant for production deployments ?
>>
>> 3. How about threads that are servicing long running HTTP Keep-alive
>> connections that never let the thread return to the pool. Are these
>> threads renewed before the server is stopped.
>
> These questions all belong on the users mailing list.
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: Executor threadRenewalDelay questions
Posted by Mark Thomas <ma...@apache.org>.
On 26/10/2011 03:13, Rohit Kelapure wrote:
> Dear All,
>
> After going through the thread renewal code in
> /tomcat-8.0.x/java/org/apache/tomcat/util/threads/TaskQueue.java ,
> /tomcat-8.0.x/java/org/apache/tomcat/util/threads/ThreadPoolExecutor.java
> and the bug (Improve ThreadLocal memory leak clean-up)
> https://issues.apache.org/bugzilla/show_bug.cgi?id=49159 I had the
> following questions-
>
> 1. Once the thread pool has been renewed after No. of active threads
> in pool * max (threadKeepAliveTimeout, longestRequest+
> threadRenewalDelay) seconds, why does the ThreadPoolExecutor still
> keep paying the price of thread renewal. ?
>
> After org.apache.tomcat.util.threads.ThreadPoolExecutor.threadRenewalDelay
> is set to 1000L it never goes back to -1. Ideally once the all the
> threads in the threadpool is renewed we should revert the
> threadRenewalDelay back to -1 and NOT call
> ThreadPoolExecutor.currentThreadShouldBeStopped()/ThreadPoolExecutor.stopCurrentThreadIfNeeded()
> in TaskQueue.poll(long, TimeUnit) or TaskQueue.take().
> Is this because we are never quite sure as to when *all* of the
> threads in the pool have been renewed ?
>
> 2. Does the thread renewal approach scale under load (i.e. all threads
> in the pool busy servicing requests and CPU close to 90%) ? Is it
> meant for production deployments ?
>
> 3. How about threads that are servicing long running HTTP Keep-alive
> connections that never let the thread return to the pool. Are these
> threads renewed before the server is stopped.
These questions all belong on the users mailing list.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org