Question about threadpools


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?

That doesn't relate to yoour topic about threadpools?

It does a GET against the _search API.

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.

Why do you want to modify the default values?

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.

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

Have a look at: Thread pools | Elasticsearch Reference [7.12] | Elastic

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.

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.

1 Like

Did you try to increase node.processors?

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

1 Like

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

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

But I'd read this: Manage compute resources | Elastic Cloud on Kubernetes [1.5] | Elastic

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.

1 Like

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

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)?:

              memory: 4Gi
              cpu: 8

I'm not either so may be ask your question in #orchestration:eck?


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