Skip to content
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

cadvisor memory legend #638

Closed
cowboy-cod3r opened this issue Apr 8, 2015 · 20 comments
Closed

cadvisor memory legend #638

cowboy-cod3r opened this issue Apr 8, 2015 · 20 comments
Labels

Comments

@cowboy-cod3r
Copy link

When looking at the total memory usage of a running container, the legend shows "hot" and "total". Is there any documentation that explains the definition "hot" and "total" and how that is calculated?

@vishh
Copy link
Contributor

vishh commented Apr 8, 2015

"hot" refers to the working set, which is held in RAM, and "total" refers
to all the memory used by a process, a part of which may reside on a swap
device.

+1 to your suggestion of documenting it. AFAIK this isn't documented
anywhere.

On Wed, Apr 8, 2015 at 1:45 PM, Sean Humbarger notifications@github.com
wrote:

When looking at the total memory usage of a running container, the legend
shows "hot" and "total". Is there any documentation that explains the
definition "hot" and "total" and how that is calculated?


Reply to this email directly or view it on GitHub
#638.

@rjnagal
Copy link
Contributor

rjnagal commented Apr 9, 2015

Hot is the working set - pages that has been recently touched as calculated
by the kernel.
Total includes hot + cold memory - where cold are the pages that have not
been touched in a while and can be reclaimed if there was global memory
pressure.

I don't think the total on cadvisor page includes swap, but we should
probably report that too.

On Wed, Apr 8, 2015 at 3:17 PM, Vish Kannan notifications@github.com
wrote:

"hot" refers to the working set, which is held in RAM, and "total" refers
to all the memory used by a process, a part of which may reside on a swap
device.

+1 to your suggestion of documenting it. AFAIK this isn't documented
anywhere.

On Wed, Apr 8, 2015 at 1:45 PM, Sean Humbarger notifications@github.com
wrote:

When looking at the total memory usage of a running container, the legend
shows "hot" and "total". Is there any documentation that explains the
definition "hot" and "total" and how that is calculated?


Reply to this email directly or view it on GitHub
#638.


Reply to this email directly or view it on GitHub
#638 (comment).

@vmarmol
Copy link
Contributor

vmarmol commented Apr 9, 2015

We used to have a bug open for this, but we closed it with some API comments. We should document this in the UI as well.

@cowboy-cod3r
Copy link
Author

Thanks for the info!

@artworkad
Copy link

What I find confusing when using cAdvisor the first time is that it says 16Gib of a total of 24 Gib memory is used.

Via free -m I found out that I actually have 22 Gib free memory and that 14 Gib are just cached by linux.

@vmarmol
Copy link
Contributor

vmarmol commented May 13, 2015

Memory accounting is interesting because different parts of the kernel do it differently. I am not sure what free -m uses. I'm curious what the hot vs. cold memory we were reporting in that case

@mboussaa
Copy link

mboussaa commented Oct 9, 2015

@vishh : the memory usage aggregated by cadvisor is the total hot (working set) memory + cold pages + swap that's right?

@vishh
Copy link
Contributor

vishh commented Oct 27, 2015

AFAIK it does not account for swap as of now.

On Mon, Oct 26, 2015 at 4:08 AM, mboussaa notifications@github.com wrote:

@vishh https://github.com/vishh : the memory usage aggregated by
cadvisor is the total hot (working set) memory + cold pages + swap that's
right?


Reply to this email directly or view it on GitHub
#638 (comment).

@mboussaa
Copy link

Working set memory == RSS ?

@jimmidyson
Copy link
Collaborator

Working set = RSS + cache (no swap as @vishh said above). We have #975 open for reporting RSS by itself.

We delegate to libcontainer to retrieve stats. We could implement this ourselves but it's kind of nice to have consistency.

@mboussaa
Copy link

the hot or total memory is sent to backend storage like influxdb ?

@jimmidyson
Copy link
Collaborator

@mboussaa
Copy link

So memory_usage (total) = RAM + Swap ? because @vishh said that cAdvisor is not supporting memory+swap accounting as of now here #913

If hot is RSS + cache what would be the total memory ?

@jimmidyson
Copy link
Collaborator

So let me try again. Details in https://www.kernel.org/doc/Documentation/cgroups/memory.txt.

Total (memory.usage_in_bytes) = rss + cache
Working set = Total - inactive (not recently accessed memory = inactive_anon + inactive_file)

How's that?

@Vanuan
Copy link

Vanuan commented Feb 25, 2016

Is working set shared between containers? Because if I sum up all container's working sets it's well above the total memory. And all containers' working sets are exactly the same.

@vishh
Copy link
Contributor

vishh commented Feb 25, 2016

working_set is not shared between containers. Are you running with swap
enabled?

On Wed, Feb 24, 2016 at 7:17 PM, John Yani notifications@github.com wrote:

Is working set shared between containers? Because if I sum up all
container's working sets it's well above the total memory. And all
containers' working sets are exactly the same.


Reply to this email directly or view it on GitHub
#638 (comment).

@Vanuan
Copy link

Vanuan commented Feb 25, 2016

Ah, it's probably heapster's bug then. I use memory/working_set_bytes_gauge which is the same, no matter which container I choose.

@Vanuan
Copy link

Vanuan commented Feb 25, 2016

Posted kubernetes-retired/heapster#1005

@cboettig
Copy link

It would be really nice if cadvisor didn't include cached memory as "used" in it's overview / summary graphs. This results in confusing / inconsistent display on most linux hosts, e.g. the "overview" will show 90% memory used while the table directly below will list no process in which memory use is high (since it is mostly in cache).

@iwankgb
Copy link
Collaborator

iwankgb commented Dec 31, 2020

Closing very old issue.

@iwankgb iwankgb closed this as completed Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests