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
mem input: Treat buffer/cache memory as available, rather than used #1617
Conversation
Signed-off-by: Nigel Stewart <nigels@nigels.com>
Originally this plugin was using MemAvailable from
|
Ah, the problem seems to run deeper. To get the cached memory, even https://gitlab.com/procps-ng/procps/blob/master/proc/sysinfo.c Leave this with me. |
See also: #1194 |
|
Signed-off-by: Nigel Stewart <nigels@nigels.com>
Yeah, that's more like it, I think.
|
How about adding new option ? I think it is better for compatibility. |
I understand the concern about compatibility. But I don't think "getting it right" should be opt-in. It's a bug that Mem.free isn't what most people would expect it mean. (It's misleading because Linux tends to run with little "free" memory by design, it's simply not a useful runtime metric, ignoring buffers and caching) |
I think the compatible thing to do for this is continue reporting free as before, but add available in addition to the the current fields. Sound good? |
sgtm |
Some output plugins may be affected . By the way ,MemAvailable is supported from Linux Kernel 3.14. I believe we should take care legacy kernel (e.g. CentOS 6.X which is supported until 2020.) |
Just FYI |
what's the status of this PR ? |
It seems like the next step for this is to do what |
sounds good to me to use those approaches:
|
ping |
@nigels-com pls rebase on top of git master for review. |
@nigels-com ping |
ping |
Will revisit, fell off my radar. |
I have cleaned-up/rebased on top of master here: #5237 |
This PR should be closed. There are now 2 competing PR's that are more up-to-date and complete: #3092 parses /proc/meminfo and collects more metrics, with some calculations as a fallback for older kernels. The new metrics collected could be concidered a breaking change though. |
Signed-off-by: Nigel Stewart nigels@nigels.com
I noticed this in the course of testing with a Raspberry Pi 1 with only half a GiB of RAM.
While
free
is reporting a smallish about of used and free memory, a good portion is used for buffering and caching.fluent-bit
is reporting this "bufferram" as used, rather than available.