diff --git a/server/src/main/java/io/druid/server/DruidProcessingConfig.java b/server/src/main/java/io/druid/server/DruidProcessingConfig.java index ada4eef609d..af596f2da02 100644 --- a/server/src/main/java/io/druid/server/DruidProcessingConfig.java +++ b/server/src/main/java/io/druid/server/DruidProcessingConfig.java @@ -31,4 +31,12 @@ public abstract class DruidProcessingConfig extends ExecutorServiceConfig { return 1024 * 1024 * 1024; } + + @Override @Config(value = "${base_path}.numThreads") + public int getNumThreads() + { + // default to leaving one core for background tasks + final int processors = Runtime.getRuntime().availableProcessors(); + return processors > 1 ? processors - 1 : processors; + } }