# Thread\_pool settings have strange defaults in es v6.2.4

**URL:** <https://discuss.elastic.co/t/thread-pool-settings-have-strange-defaults-in-es-v6-2-4/169419>\
**Category:** Elasticsearch\
**Created:** [February 21, 2019, 1:31pm UTC](https://discuss.elastic.co/t/thread-pool-settings-have-strange-defaults-in-es-v6-2-4/169419 "2019-02-21T13:31:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)\
**Post date:** [February 21, 2019, 1:31pm UTC](https://discuss.elastic.co/t/thread-pool-settings-have-strange-defaults-in-es-v6-2-4/169419/1 "2019-02-21T13:31:33Z")

</div>

In the `elasticsearch.yml` config I'm setting the search `thread_pool` size to be `4200`, like so:

```auto
thread_pool.search.queue_size: 4200

```

But the other day I received the following error:

```auto
ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=]]; nested: 
  ElasticsearchException[Elasticsearch exception [
    type=es_rejected_execution_exception, 
    reason=rejected execution of org.elasticsearch.common.util.concurrent.TimedRunnable@4993756d on 
    QueueResizingEsThreadPoolExecutor[
      name = es-live-7/search, 
      queue capacity = 1000, 
      min queue capacity = 1000, 
      max queue capacity = 1000, 
      frame size = 2000, 
      targeted response rate = 1s, 
      task execution EWMA = 10.5ms, 
      adjustment amount = 50, 
 org.elasticsearch.common.util.concurrent.QueueResizingEsThreadPoolExecutor@28b39f6f[Running, 
  pool size = 13, 
  active threads = 13, 
  queued tasks = 1088, 
  completed tasks = 89917206]]]];

```

Why is it reporting the queue capacity as 1000 and not 4200?  
I know that 1000 is the default, so did my config not work?  
How can I enforce a minimum queue size of 4200? Do I need to set:

```auto
thread_pool.search.min_queue_size: 4200

```

as well?  
Or do I just need to change the `type` of queue to `fixed`?  
If so, where is the documentation on setting that config?

I just executed `GET /_cluster/settings?include_defaults=true`  
then I get this:

```auto
"search": {
                "max_queue_size": "1000",
                "queue_size": "4200",
                "size": "13",
                "auto_queue_frame_size": "2000",
                "target_response_time": "1s",
                "min_queue_size": "1000"
            },

```

Why would the max\_queue\_size default to be above the queue\_size?

I think what I need to do is change my configuration to:

```auto
thread_pool:
  search:
    min_queue_size: 4200
    max_queue_size: 4200
    queue_size: 4200

```

Can someone please confirm?  
Sorry for the rambling post!

Thanks!

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [February 21, 2019, 1:43pm UTC](https://discuss.elastic.co/t/thread-pool-settings-have-strange-defaults-in-es-v6-2-4/169419/2 "2019-02-21T13:43:58Z")

</div>

The [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/modules-threadpool.html#modules-threadpool) tell us that the `search` thread pool is of type `fixed_auto_queue_size` and has the following to say about its parameters (emphasis mine):

> The `queue_size` allows to control the **initial size** of the queue of pending requests that have no threads to execute them.
> 
> The `min_queue_size` setting controls the minimum amount the `queue_size` can be adjusted to.
> 
> The `max_queue_size` setting controls the maximum amount the `queue_size` can be adjusted to.

You have set the initial size to be above the maximum size, so the queue shrinks almost immediately to the default maximum of 1000.

---

<div class="post-metadata">

**Author:** ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)\
**Post date:** [February 21, 2019, 1:47pm UTC](https://discuss.elastic.co/t/thread-pool-settings-have-strange-defaults-in-es-v6-2-4/169419/3 "2019-02-21T13:47:00Z")

</div>

Thanks! Missed that in my obvious skimming. Time to cycle 10 es nodes, then.

---

<div class="post-metadata">

**Author:** ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)\
**Post date:** [February 21, 2019, 1:49pm UTC](https://discuss.elastic.co/t/thread-pool-settings-have-strange-defaults-in-es-v6-2-4/169419/4 "2019-02-21T13:49:15Z")

</div>

Quick question: if this is a cluster-wide setting, and I roll in a new node with a different setting...what happens?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [February 21, 2019, 3:05pm UTC](https://discuss.elastic.co/t/thread-pool-settings-have-strange-defaults-in-es-v6-2-4/169419/5 "2019-02-21T15:05:25Z")

</div>

These settings are not cluster-wide, they're local to each node. It's probably not the _best_ idea to have them set differently across different nodes, but there's no technical constraint that prevents you from doing so.

---

<div class="post-metadata">

**Author:** ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)\
**Post date:** [February 22, 2019, 9:50am UTC](https://discuss.elastic.co/t/thread-pool-settings-have-strange-defaults-in-es-v6-2-4/169419/6 "2019-02-22T09:50:25Z")

</div>

Ah yes, I see that when I deploy a new node with the different settings and run `_cluster/settings` against it the values are different.

Note to self: `_cluster/settings` does not show cluster-wide settings.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 22, 2019, 9:50am UTC](https://discuss.elastic.co/t/thread-pool-settings-have-strange-defaults-in-es-v6-2-4/169419/7 "2019-03-22T09:50:34Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
