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

MemUsed metric includes Buffered/Cached memory #14

Closed
BestFriendChris opened this issue Apr 6, 2012 · 3 comments
Closed

MemUsed metric includes Buffered/Cached memory #14

BestFriendChris opened this issue Apr 6, 2012 · 3 comments
Assignees
Milestone

Comments

@BestFriendChris
Copy link

In the Memory check, physUsed is calculated by MemTotal - MemFree as shown below

physTotal = int(meminfo['MemTotal'])
physFree = int(meminfo['MemFree'])
physUsed = physTotal - physFree

(found at checks/system.py)

This makes it awkward (in Datadog graphs) to differentiate between memory being used by the cache and memory being used by normal processes.

I'd like to change the physUsed definition to be

physTotal = int(meminfo['MemTotal'])
physFree = int(meminfo['MemFree'])
physBuffers = int(meminfo['Buffers'])
physCached = int(meminfo['Cached'])
physUsed = physTotal - physFree - physBuffers - physCached

Alternatively, we could add another data point that represents physUsed - physBuffers - physCached. I'm at a loss on what to call it however.

One side point; free deals with this problem by showing both:

             total       used       free     shared    buffers     cached
Mem:           512        494         17          0         76        326
-/+ buffers/cache:         91        420

The -/+ buffers/cache line represents used - buffers - cached and free + buffers + cached

Chris

@ghost ghost assigned alq666 Apr 6, 2012
@alq666
Copy link
Member

alq666 commented Apr 6, 2012

@BestFriendChris I'm going to cut a new metric for "usable" memory: free + buffers + cached. I'm cleaning up that code too as it's a bit rusty.

@BestFriendChris
Copy link
Author

@alq666 Cool. My ultimate goal is to have a stacked line graph that contains (my definition of) used, buffers, cached, free

@alq666
Copy link
Member

alq666 commented Apr 16, 2012

We released v2.2.9 last week. It supports additional memory metrics.

@alq666 alq666 closed this as completed Apr 16, 2012
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

No branches or pull requests

2 participants