costin 01/04/21 11:42:51
Modified: src/share/org/apache/tomcat/util/threads ThreadPool.java
Log:
1418 - stop/start puts the thread pool in the same state ( all the threads are
stoped, then shouldStop is reset to false and we restart ).
Reduced the min threads ( thread creation is much cheaper than process
creation, and after the threads are created they will remain allocated ).
Also, increased max threads - tomcat can now handle way over 100 RPS, no need
to limit it in the thread pool settings.
Revision Changes Path
1.4 +13 -5
jakarta-tomcat/src/share/org/apache/tomcat/util/threads/ThreadPool.java
Index: ThreadPool.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/threads/ThreadPool.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ThreadPool.java 2001/03/02 04:11:52 1.3
+++ ThreadPool.java 2001/04/21 18:42:51 1.4
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/threads/ThreadPool.java,v
1.3 2001/03/02 04:11:52 costin Exp $
- * $Revision: 1.3 $
- * $Date: 2001/03/02 04:11:52 $
+ * $Header:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/threads/ThreadPool.java,v
1.4 2001/04/21 18:42:51 costin Exp $
+ * $Revision: 1.4 $
+ * $Date: 2001/04/21 18:42:51 $
*
* ====================================================================
*
@@ -79,9 +79,9 @@
/*
* Default values ...
*/
- public static final int MAX_THREADS = 100;
+ public static final int MAX_THREADS = 200;
public static final int MAX_SPARE_THREADS = 50;
- public static final int MIN_SPARE_THREADS = 10;
+ public static final int MIN_SPARE_THREADS = 4;
public static final int WORK_WAIT_TIMEOUT = 60*1000;
/*
@@ -142,6 +142,13 @@
}
public synchronized void start() {
+ stopThePool=false;
+ currentThreadCount = 0;
+ currentThreadsBusy = 0;
+ maxThreads = MAX_THREADS;
+ maxSpareThreads = MAX_SPARE_THREADS;
+ minSpareThreads = MIN_SPARE_THREADS;
+
adjustLimits();
openThreads(minSpareThreads);
@@ -378,6 +385,7 @@
shouldTerminate = false;
this.p = p;
t = new Thread(this);
+ t.setName( "MonitorRunnable" );
t.start();
}