From d35a3b03c842c142fef3dbde4622fee14661055b Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Mon, 25 Mar 2013 23:34:44 +0100 Subject: [PATCH] Warmers: Have an explicit warmer thread pool add 1 in case there is 1 core... closes #2815 --- src/main/java/org/elasticsearch/threadpool/ThreadPool.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/elasticsearch/threadpool/ThreadPool.java b/src/main/java/org/elasticsearch/threadpool/ThreadPool.java index df6409ec57d..c9842509a85 100644 --- a/src/main/java/org/elasticsearch/threadpool/ThreadPool.java +++ b/src/main/java/org/elasticsearch/threadpool/ThreadPool.java @@ -109,7 +109,7 @@ public class ThreadPool extends AbstractComponent { .put(Names.FLUSH, settingsBuilder().put("type", "scaling").put("keep_alive", "5m").put("size", 10).build()) .put(Names.MERGE, settingsBuilder().put("type", "scaling").put("keep_alive", "5m").put("size", 20).build()) .put(Names.REFRESH, settingsBuilder().put("type", "scaling").put("keep_alive", "5m").put("size", 10).build()) - .put(Names.WARMER, settingsBuilder().put("type", "scaling").put("keep_alive", "5m").put("size", Math.min(Runtime.getRuntime().availableProcessors() / 2, 5)).build()) + .put(Names.WARMER, settingsBuilder().put("type", "scaling").put("keep_alive", "5m").put("size", Math.min(((Runtime.getRuntime().availableProcessors() + 1) / 2), 5)).build()) .put(Names.CACHE, settingsBuilder().put("type", "scaling").put("keep_alive", "5m").put("size", 4).build()) .put(Names.SNAPSHOT, settingsBuilder().put("type", "scaling").put("keep_alive", "5m").put("size", 5).build()) .build();