diff options
Diffstat (limited to 'container-core')
-rw-r--r-- | container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java | 2 | ||||
-rw-r--r-- | container-core/src/main/resources/configdefinitions/threadpool.def | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java b/container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java index 6251f1975dd..117fd995ff4 100644 --- a/container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java +++ b/container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java @@ -36,7 +36,7 @@ public class ContainerThreadPool extends AbstractComponent implements AutoClosea int coreNumThreads = computeCoreThreadPoolSize(threadpoolConfig.corePoolSize(), maxNumThreads); WorkerCompletionTimingThreadPoolExecutor executor = new WorkerCompletionTimingThreadPoolExecutor(coreNumThreads, maxNumThreads, - 0L, TimeUnit.SECONDS, + (int)threadpoolConfig.keepAliveTime() * 1000, TimeUnit.MILLISECONDS, createQ(threadpoolConfig.queueSize(), maxNumThreads), ThreadFactoryFactory.getThreadFactory(threadpoolConfig.name()), metric); diff --git a/container-core/src/main/resources/configdefinitions/threadpool.def b/container-core/src/main/resources/configdefinitions/threadpool.def index 7d57cd3e35c..5266c95ef19 100644 --- a/container-core/src/main/resources/configdefinitions/threadpool.def +++ b/container-core/src/main/resources/configdefinitions/threadpool.def @@ -9,6 +9,9 @@ maxthreads int default=500 # The number of threads to keep in the pool, even if they are idle corePoolSize int default=500 +# The number of seconds that excess idle threads will wait for new tasks before terminating +keepAliveTime double default=60.0 + ## max queue size ## There can be queueSize + maxthreads requests inflight concurrently ## The container will start replying 503 |