Heap size when running elasticsearch on kubernetes

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?

Yep, the same principle applies. If you have allocated 8GB of memory to a pod then Elasticsearch must have a heap size no greater than 4GB. From the link you shared:

Elasticsearch requires memory for purposes other than the JVM heap and it is important to leave space for this. For instance, Elasticsearch uses off-heap buffers for efficient network communication, relies on the operating system’s filesystem cache for efficient access to files, and the JVM itself requires some memory too.

1 Like

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