tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rohit Kelapure <kelap...@gmail.com>
Subject Executor threadRenewalDelay questions
Date Wed, 26 Oct 2011 02:13:07 GMT
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


Mime
View raw message