Kubernetes will not OOM a pod for page cache use. The container_memory_used_bytes includes page cache and is not what you want to compare. What you want to do is look at is container_memory_rss or container_memory_working_set_bytes.
On Thu, Feb 9, 2023 at 10:56 AM 'Björn Johansson' via Prometheus Users < [email protected]> wrote: > I'm struggling to understand how prometheus uses memory. I've done some > reading and I find pieces of information here and there but I don't get the > full picture. > > Some context first. > We are running prometheus in kubernetes. Not the operator, just vanilla > prometheus. > We are monitoring memory usage with the > "container_memory_limit_utilization" and "container_memory_used_bytes" > metrics. > > I've seen in some previous conversation that these metrics are not ideal > for monitoring usage since they include the page cache as well. This is > where I start getting confused. > Kubernetes doesn't make any distinction if memory is the page cache or the > actual memory used by prometheus. The pod will OOM and be evicted once it > hits the limit. > Will page cache be released when needed and before the limit is hit? > > Can you please help me understand how this works. > How should I monitor prometheus so that I can be sure it has the memory it > needs? > > Thanks > Björn > > -- > You received this message because you are subscribed to the Google Groups > "Prometheus Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/prometheus-users/6428d3f7-2fff-4783-9e4d-13f1a5e442c8n%40googlegroups.com > <https://groups.google.com/d/msgid/prometheus-users/6428d3f7-2fff-4783-9e4d-13f1a5e442c8n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CABbyFmrXoVYqMG3FW1Me7gAyO4cQ%3DqGhKQ2p%3D2qxci2rZ7KSOg%40mail.gmail.com.

