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