diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-06-09 16:04:06 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-07-14 14:06:49 +0200 |
commit | 04635b6044c0660984dee6ce900125c93e1beb6c (patch) | |
tree | 9e85e656f28d2eaa022e0c9319b93fee62e561ce /container-core | |
parent | 45d36c82b2ccbd52b7b6bc6d002520d9d83a307e (diff) |
Scale core pool size with actual number of cores as fallback
Diffstat (limited to 'container-core')
-rw-r--r-- | container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java | 4 |
1 files changed, 3 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 6fc9da298a8..edbe12b64c6 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 @@ -83,7 +83,9 @@ public class ContainerThreadPool implements AutoCloseable { } private static int computeCoreThreadPoolSize(int corePoolSize, int maxNumThreads) { - return Math.min(corePoolSize, maxNumThreads); + return Math.min( + corePoolSize <= 0 ? Runtime.getRuntime().availableProcessors() * 2 : corePoolSize, + maxNumThreads); } } |