Open stevekuznetsov opened 3 years ago
/sig instrumentation
/cc @ehashman
This would be a great addition to the reference docs - especially with a visual.
/triage accepted /priority backlog /kind feature /language en
/help
@ehashman: This request has been marked as needing help from a contributor.
Please ensure the request meets the requirements listed here.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help
command.
@brennerm as you've been doing a great job drafting diagrams, I thought you might like to know about this feature request too
/cc @bobbypage
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale
/remove-lifecycle stale
xref https://github.com/google/cadvisor/issues/2138
The above issue from cAdvisor seems to document how all of this goes on ...
OK, so from what I can tell, the following things are true:
container_memory_working_set_bytes = container_memory_usage_bytes - <inactive_memory>
We can see this calculation here, and <inactive_memory>
is a kernel concept
Furthermore:
container_memory_usage_bytes == container_memory_rss + container_memory_cache + container_memory_swap + <kernel memory>
Where <kernel memory>
is memory allocated within the kernel, not yet exposed from cAdvisor (and therefore not exposed to Prometheus) as of https://github.com/google/cadvisor/issues/2138
The kernel and kubelet
will use the container_memory_working_set_bytes
for OOMKills.
@ehashman @bobbypage @sftim @derekwaynecarr it doesn't look like the subject matter experts on this are too keen on documenting this, so I'll try to do it, I guess. Who will review my work, and if they understand this well could they perhaps jot down more thoughts in response to what I've written?
Perhaps @mrunalp or @rphillips know?
@stevekuznetsov I'll make sure we get a reviewer, I might pull in @dashpole and I'll take a look as well.
/lifecycle frozen
@stevekuznetsov i am happy to help review.
I wonder if we could sketch out (and for now only sketch out) what we want, saving the detailed work for a docs sprint at the next KubeCon.
Totally! I think the questions I always ended up coming to were:
/assign
@jai Are you still working on this issue?
Unassigning @jai as didn't receive any updates. Please assign if you get back to this or anyone can also assign to this issue /unassign @jai
This is a Feature Request
What would you like to be added A document that explains what all the different container memory metrics mean and how they are interrelated.
Why is this needed Today, the following metrics exist for container memory:
container_memory_cache
container_memory_mapped_file
container_memory_max_usage_bytes
container_memory_rss
container_memory_swap
container_memory_usage_bytes
container_memory_working_set_bytes
I would like to see a document that explains what they are, how they are different or similar to each other, how they nest, what
container=""
andcontainer="POD"
mean, which metric(s) are used by thekubelet
to evict, whyusage_bytes
andmax_usage_bytes
might differ, the effects of quantized sampling, etc.Comments A visual description would be amazing here, as there are hierarchical relationships that would benefit from such a view.