# Cores Usage by Elasticsearch on Kubernetes

**URL:** <https://discuss.elastic.co/t/cores-usage-by-elasticsearch-on-kubernetes/180536>\
**Category:** Elasticsearch\
**Created:** [May 10, 2019, 10:32am UTC](https://discuss.elastic.co/t/cores-usage-by-elasticsearch-on-kubernetes/180536 "2019-05-10T10:32:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RdrgPorto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rdrgporto/32/13278_2.png) [@RdrgPorto](https://discuss.elastic.co/u/RdrgPorto)\
**Post date:** [May 10, 2019, 10:32am UTC](https://discuss.elastic.co/t/cores-usage-by-elasticsearch-on-kubernetes/180536/1 "2019-05-10T10:32:32Z")

</div>

Hi, everyone:

We have been experiencing poor indexing performance on an **Elastiscsearch cluster deployed with Kubernetes**. The Kubernetes cluster consists on **4 nodes** (dedicated machines running Ubuntu) with **32Gb of RAM and 4c/8t**. We deploy **4 Elasticsearch nodes** one on each of the Kubernetes nodes.

When performing some benchmarks using **Filebeat** , we achieved almost twice the indexing speed using only one **Elasticsearch node deployed with Docker** alone than when using the 4 node Elasticsearch cluster deployed with Kubernetes. That pointed our suspicious to Kubernetes.

After conducting several tests we found out the root cause of the problem. Somehow when Kubernetes launches the Elasticsearch pods it must be setting some JVM/Docker parameters that causes the **java function runtime.availableProcessors() to report 1 instead of 8**.

Due to this fact, when querying the **Elasticsearch** cluster stats (\_cluster/stats) it **reported only 1 available and 1 allocated processor** :

```
{
[...]
"os" : {
      "available_processors" : 1,
      "allocated_processors" : 1
      }
[...]
}

```

Since Elasticsearch uses available\_processors to allocate the number of threads for the internal thread pools (\_nodes/thread\_pool) the pools were configured with only one thread, which caused the poor indexing performance.

We managed to partially workaround this **by setting a limit of 6 processors to each of the Elasticsearch nodes in the Kubernetes deployment**. When the limit is stablished, both available\_processors and allocated\_processors are set to 6.

We would like to know if there is any way to configure **Elasticsearch** ( **elasticsearch.yml** or **java\_opts** ) without setting a limit on **Kubernetes**.

Is it possible ?

Thanks in advance,

Rodrigo 🖖

---

<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:** [June 7, 2019, 10:32am UTC](https://discuss.elastic.co/t/cores-usage-by-elasticsearch-on-kubernetes/180536/2 "2019-06-07T10:32:33Z")

</div>

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