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

Adding support for MemAvailable #1993

Merged
merged 4 commits into from
Oct 26, 2015
Merged

Adding support for MemAvailable #1993

merged 4 commits into from
Oct 26, 2015

Conversation

truthbk
Copy link
Member

@truthbk truthbk commented Oct 22, 2015

Based on: #1826 - bringing in @jraede changes and making sure it's only reported if the kernel actually has it in /proc/meminfo

@remh
Copy link

remh commented Oct 23, 2015

This will need some changes in the backend as well.
@olivielpeau i think you've done similar things in the past when you add guest cpu metrics. Can you work with @truthbk on that please ?

@truthbk
Copy link
Member Author

truthbk commented Oct 23, 2015

@remh I was adding the MemAvailable stuff to the backend, but it kind of feels like redundant. Maybe we should just report MemAvailable as MemUsable when its available, and compute usable when it's not available (aka. like it's done now). Thoughts?

@truthbk truthbk force-pushed the jaime/memavailable branch from e014fb9 to a0efe9a Compare October 23, 2015 21:55
@truthbk
Copy link
Member Author

truthbk commented Oct 23, 2015

It doesn't make sense to report usable and available. We just use available if the kernel has it, or compute usable if it's not.

memData['physUsable'] = int(meminfo.get('MemAvailable', 0)) / 1024
else:
# Usable is relative since cached and buffers are actually used to speed things up.
memData['physUsable'] = memData['physFree'] + memData['physBuffers'] + memData['physCached']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't look like physBuffers and physCached are populated until L374-375 . Maybe move this block of code below that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting that! Careless.

@talwai
Copy link
Contributor

talwai commented Oct 26, 2015

👍

truthbk added a commit that referenced this pull request Oct 26, 2015
@truthbk truthbk merged commit 86bfe5a into master Oct 26, 2015
@truthbk truthbk deleted the jaime/memavailable branch October 26, 2015 16:42
@remh
Copy link

remh commented Oct 30, 2015

@talwai @truthbk Did you check if those metrics were roughly equivalent ? We need to make sure that they'll be concistent with the previous value.

@truthbk
Copy link
Member Author

truthbk commented Nov 3, 2015

@remh the thing is MemAvailable was introduced precisely because it's not always so straight-forward to estimate the amount of memory available to the system: https://access.redhat.com/solutions/776393. As it turns out the typical way of doing free + cached + buffers didn't always reflect the actual memory available.

@JohnLZeller
Copy link
Contributor

@remh can +1 what @truthbk is saying here. Looks like the MemAvailable number is lower than our calculation (ex memavail: 529 VS calculated: 663), meaning that our manual calculation is actually off a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants