-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Memory locking is not enabled #7
Comments
Hi @micw! The recommended memory settings is to have swap disabled completely. By default the kubelet disables swapping and I believe it is actually not even possible to have swap enabled inside of Kubernetes container even if you really wanted to (#53533). Memory locking is an alternative method for environments where disabling swap is not possible. Could you test the output of |
Swapon won't work within the container, only on the host. I deploy on-premise and usually follow the k8s recommendation not to have swap. But on some environments with long-running processes, I enable swapping and in this environments I'd like to ensure that ES has it's memory reserved. Another thing is memory pressure handling: If ES does not reserve memory other pods without memory constraints may be scheduled on the host. When ES starts using the memory, the other pods are moved away. If ES does it's locking, the memory is reserved from beginning.
Kubelet just checks if it's enabled. It's an option that can be disabled and swap can be added to the host (kubernetes/kubernetes#53533 (comment)). |
Interesting. Thanks for the extra information.
One of the requirements for swap to be enabled in that comment is "containers which do not specify a memory requirement will then by default be able to use all of the machine memory, including swap" . By default a resource request and limit is being set for memory with this chart which would prevent the container from using swap.
Could you explain what you mean here? When running this in a pod on GKE I can see that swap is not enabled. When I run it in a docker container on a non-kubernetes host with swap enabled I can see swap as expected. Running locally on my machine:
I'm not against adding support memory locking to this chart. I just want to make sure it is actually possible for swap to be enabled inside the container before adding it in. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had recent activity since being marked as stale. |
Hi,
your doc recommend to enable memory locking at bootstrap - this is completely missing on the helm chart.
It's a bit tricky on kubernetes but it's possible:
enable the required capabilities
set ulimit before starting elasticsearch
enable via environment
This colud be configurable via helm variable.
The text was updated successfully, but these errors were encountered: