# Question about threadpools

**URL:** <https://discuss.elastic.co/t/question-about-threadpools/268888>\
**Category:** Elasticsearch\
**Created:** [March 31, 2021, 9:22am UTC](https://discuss.elastic.co/t/question-about-threadpools/268888 "2021-03-31T09:22:33Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![nyquillus](https://avatars.discourse-cdn.com/v4/letter/n/c77e96/32.png) [@nyquillus](https://discuss.elastic.co/u/nyquillus)\
**Post date:** [March 31, 2021, 9:22am UTC](https://discuss.elastic.co/t/question-about-threadpools/268888/1 "2021-03-31T09:22:33Z")

</div>

Hi,

It's a simple question but I couldn't be sure and couldn't find anything that specifies this. When using Kibana on discover page what operation is used on elasticsearch to show logs? Is it Get or Search?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 31, 2021, 10:04am UTC](https://discuss.elastic.co/t/question-about-threadpools/268888/2 "2021-03-31T10:04:39Z")

</div>

That doesn't relate to yoour topic about threadpools?

It does a `GET` against the `_search` API.

---

<div class="post-metadata">

**Author:** ![nyquillus](https://avatars.discourse-cdn.com/v4/letter/n/c77e96/32.png) [@nyquillus](https://discuss.elastic.co/u/nyquillus)\
**Post date:** [March 31, 2021, 2:03pm UTC](https://discuss.elastic.co/t/question-about-threadpools/268888/3 "2021-03-31T14:03:55Z")

</div>

Isn't there a threadpool used when performing this action? I'm planning to increase the thread count for this operation if it uses a threadpool to perform this.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 31, 2021, 2:46pm UTC](https://discuss.elastic.co/t/question-about-threadpools/268888/4 "2021-03-31T14:46:17Z")

</div>

Why do you want to modify the default values?

---

<div class="post-metadata">

**Author:** ![nyquillus](https://avatars.discourse-cdn.com/v4/letter/n/c77e96/32.png) [@nyquillus](https://discuss.elastic.co/u/nyquillus)\
**Post date:** [March 31, 2021, 3:10pm UTC](https://discuss.elastic.co/t/question-about-threadpools/268888/5 "2021-03-31T15:10:33Z")

</div>

We run the stack on a single host with 2x20core cpus on kubernetes. The allocated thread counts are at minimum values such as 1, as a result i have very low cpu usage on the machine and i think some performance loss as well. I'm planning to do an upgrade on warmer, write, search and get threadpools.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 31, 2021, 3:21pm UTC](https://discuss.elastic.co/t/question-about-threadpools/268888/6 "2021-03-31T15:21:38Z")

</div>

I'd not touch that as the default values are pretty good...

Have a look at: [Thread pools | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-threadpool.html#node.processors)

> The number of processors is automatically detected, and the thread pool settings are automatically set based on it. In some cases it can be useful to override the number of detected processors. This can be done by explicitly setting the `node.processors` setting.

---

<div class="post-metadata">

**Author:** ![nyquillus](https://avatars.discourse-cdn.com/v4/letter/n/c77e96/32.png) [@nyquillus](https://discuss.elastic.co/u/nyquillus)\
**Post date:** [March 31, 2021, 5:02pm UTC](https://discuss.elastic.co/t/question-about-threadpools/268888/7 "2021-03-31T17:02:15Z")

</div>

yes the default values are pretty good but my problem is that i dont think the stack detects the correct amount of threads or cpus. I have a test stack as well on a virtual machine with 8 cores running on docker, it detects 8 cores and distributes the thread counts accordingly. But the production stack sees 1 processor/1core i think with "get cluster stats"it might be about having the cluster on k8s. I've run some custom allocations on my test stack as well and it seems to have worked nicely. And as i said production stack uses like 10% cpu on load. The stack gets around 250m entries a day which accumulates to around 150-200gb of data with a potential to increase in the near future. So I'd like to at least use more than 10% of my 40 core double cpu.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 31, 2021, 9:15pm UTC](https://discuss.elastic.co/t/question-about-threadpools/268888/8 "2021-03-31T21:15:20Z")

</div>

Did you try to increase `node.processors`?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 31, 2021, 9:16pm UTC](https://discuss.elastic.co/t/question-about-threadpools/268888/9 "2021-03-31T21:16:18Z")

</div>

Yeah this would be a better idea, rather than altering threadpools.

---

<div class="post-metadata">

**Author:** ![nyquillus](https://avatars.discourse-cdn.com/v4/letter/n/c77e96/32.png) [@nyquillus](https://discuss.elastic.co/u/nyquillus)\
**Post date:** [April 1, 2021, 5:44am UTC](https://discuss.elastic.co/t/question-about-threadpools/268888/10 "2021-04-01T05:44:22Z")

</div>

how can i implement that with a yaml file? Enter an environment variable below elasticsearch? Or is it doable from dev tools?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 1, 2021, 6:51am UTC](https://discuss.elastic.co/t/question-about-threadpools/268888/11 "2021-04-01T06:51:12Z")

</div>

It's a node setting so in elasticsearch.yml.

But I'd read this: [Manage compute resources | Elastic Cloud on Kubernetes [2.10] | Elastic](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-managing-compute-resources.html)

> The value set for cpu requests directly impacts Elasticsearch `node.processors` setting. For example, with `resources.requests.cpu: 1` , Elasticsearch effectively relies on a single core, which may significantly limit performance. Consider setting a higher value that matches the desired number of cores Elasticsearch can use. You can also set your own value for `node.processors` in the Elasticsearch config.

I'd change then `resources.requests.cpu` as shown in the example.

---

<div class="post-metadata">

**Author:** ![nyquillus](https://avatars.discourse-cdn.com/v4/letter/n/c77e96/32.png) [@nyquillus](https://discuss.elastic.co/u/nyquillus)\
**Post date:** [April 1, 2021, 7:31am UTC](https://discuss.elastic.co/t/question-about-threadpools/268888/12 "2021-04-01T07:31:17Z")

</div>

Thanks i'll look into this and post updates here.

---

<div class="post-metadata">

**Author:** ![nyquillus](https://avatars.discourse-cdn.com/v4/letter/n/c77e96/32.png) [@nyquillus](https://discuss.elastic.co/u/nyquillus)\
**Post date:** [April 2, 2021, 7:47am UTC](https://discuss.elastic.co/t/question-about-threadpools/268888/13 "2021-04-02T07:47:18Z")

</div>

Hello again,

I tried adding an env variable "processors=x" on docker-compose.yaml for my test stack and it adjusted the threadpool allocations accordingly and everything works fine. I'm not experienced in kubernetes so i was wondering, will that same env variable work on a kubernetes yaml file or is my only option specifying something like this(as shown in the link you shared)?:

```
resources:
            requests:
              memory: 4Gi
              cpu: 8
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 2, 2021, 8:08am UTC](https://discuss.elastic.co/t/question-about-threadpools/268888/14 "2021-04-02T08:08:31Z")

</div>

> [@nyquillus](#):
>
> I'm not experienced in kubernetes

I'm not either so may be ask your question in #Elastic Cloud on Kubernetes (ECK)?

---

<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:** [April 30, 2021, 8:08am UTC](https://discuss.elastic.co/t/question-about-threadpools/268888/15 "2021-04-30T08:08:53Z")

</div>

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