-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metricbeat 7.12.1 kubernetes.container.memory.usage.limit.pct is calculated incorrectly #25657
Comments
Pinging @elastic/integrations (Team:Integrations) |
Hi @jsoriano, No the affected nodes are all Ubuntu 18.04.5 LTS |
as you see here the workingset is 580MB, the memory limit is 768MB (doesn't show in the output), but the limit.pct says it is 0,998 which is based on the memory.usage.bytes, which is 766.5MB |
@F-Potter At what point does the pod get OOM killed? Do you have an example of the usage.limit.pct going above 100%? |
Oh yes, you are right, this value is also available in other OSs, this will need further investigation. |
@brianharwell will look at it, not sure if it stops at 100% or goes over it, but the issue is more that the wrong value is measured, since k8s is looking at the kubernetes.container.memory.workingset.bytes. So monitoring a different value will result in a different percentage which results in wrong alerting |
The limit.pct stops at 1 (100%), so won't get higher than that. |
I am curious to see how this works on Linux because on Windows, I get memory errors when the workingset bytes is 72% of the memory limit. I can try my test app on Linux and see what happens. |
This doesn't look strictly incorrect -- |
Hi,
Metricbeat is providing the kubernetes.container.memory.usage.limit.pct value by obtaining the memory.max_usage_in_bytes (which can be divined by setting a resource memory limit in the kubernetes deployment) and dividing it by the kubernetes.container.memory.usage.bytes.
While kubernetes is OOM killing containers based on the kubernetes.container.memory.workingset.bytes. Meaning that the kubernetes.container.memory.usage.limit.pct currently is not a good value to have alerting on, since the kubernetes.container.memory.usage.bytes is higher than the kubernetes.container.memory.workingset.bytes and giving false positives that the container is almost OOM killed, while in reality it is still okay, until the kubernetes.container.memory.workingset.bytes is reaching the resource memory limit.
Is it possible to adjust the kubernetes.container.memory.usage.limit.pct based on the kubernetes.container.memory.workingset.bytes?
The text was updated successfully, but these errors were encountered: