Browse Source

Set queue sizes by default on bulk/index thread pools
Now that we properly fixed the ability to set the queue size on the index / bulk thread pool, we should actually set them to a somehow reasonable value to protect from users potentially overflowing our system.

I suggest defaults to be 50 for bulk, and 200 for indexing.

Also, set the thread pool for get, which we should set (in a similar value to a "read" queue size we have today).
closes #3888

Shay Banon 12 years ago
parent
commit
420b3396f4

+ 11 - 1
docs/reference/modules/threadpool.asciidoc

@@ -9,22 +9,32 @@ pools, but the important ones include:
 `index`:: 
     For index/delete operations, defaults to `fixed`, 
     size `# of available processors`. 
+    queue_size `200`.
 
 `search`:: 
     For count/search operations, defaults to `fixed`,
     size `3x # of available processors`. 
+    queue_size `1000`.
 
 `suggest`::
     For suggest operations, defaults to `fixed`,
     size `# of available processors`.
+    queue_size `1000`.
 
 `get`:: 
     For get operations, defaults to `fixed`
     size `# of available processors`.
+    queue_size `1000`.
 
-`bulk`:: 
+`bulk`::
     For bulk operations, defaults to `fixed`
     size `# of available processors`.
+    queue_size `50`.
+
+`percolate`::
+    For percolate operations, defaults to `fixed`
+    size `# of available processors`.
+    queue_size `1000`.
 
 `warmer`:: 
     For segment warm-up operations, defaults to `scaling`

+ 3 - 3
src/main/java/org/elasticsearch/threadpool/ThreadPool.java

@@ -105,9 +105,9 @@ public class ThreadPool extends AbstractComponent {
         int halfProcMaxAt10 = Math.min(((availableProcessors + 1) / 2), 10);
         defaultExecutorTypeSettings = ImmutableMap.<String, Settings>builder()
                 .put(Names.GENERIC, settingsBuilder().put("type", "cached").put("keep_alive", "30s").build())
-                .put(Names.INDEX, settingsBuilder().put("type", "fixed").put("size", availableProcessors).build())
-                .put(Names.BULK, settingsBuilder().put("type", "fixed").put("size", availableProcessors).build())
-                .put(Names.GET, settingsBuilder().put("type", "fixed").put("size", availableProcessors).build())
+                .put(Names.INDEX, settingsBuilder().put("type", "fixed").put("size", availableProcessors).put("queue_size", 200).build())
+                .put(Names.BULK, settingsBuilder().put("type", "fixed").put("size", availableProcessors).put("queue_size", 50).build())
+                .put(Names.GET, settingsBuilder().put("type", "fixed").put("size", availableProcessors).put("queue_size", 1000).build())
                 .put(Names.SEARCH, settingsBuilder().put("type", "fixed").put("size", availableProcessors * 3).put("queue_size", 1000).build())
                 .put(Names.SUGGEST, settingsBuilder().put("type", "fixed").put("size", availableProcessors).put("queue_size", 1000).build())
                 .put(Names.PERCOLATE, settingsBuilder().put("type", "fixed").put("size", availableProcessors).put("queue_size", 1000).build())