heap size when running elasticsearch cluster on kubernetes

1/9/2020

I am running elasticsearch cluster on Kubernetes cluster. I have a need to increase the heap size. Right now the heap size is 4gb and memory allocated to the pod is 8gb. When setting up elastic search cluster on VMs/BMs I have always followed the principle that heap size should not be more than 50% of physical RAM. Please follow link https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html Now my question is, will this principle work in the same manner when running elastic search on K8 or how to decide the heap size when running ES on K8?

-- Nitesh Ratnaparkhe
elastic-stack
elasticsearch
kubernetes

1 Answer

1/9/2020

The heap size should be half the size of RAM allocated to pods.

From elasticsearch guide:

The heap size should be half the size of RAM allocated to the Pod. To minimize disruption caused by Pod evictions due to resource contention, you should run Elasticsearch pods at the "Guaranteed" QoS level by setting both requests and limits to the same value.

-- Shashank V
Source: StackOverflow