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
Inconsistent memory reporting for node containers #1471
Comments
[shaunmulligan] This issue has attached support thread https://jel.ly.fish/7e2ec3cd-f10e-4b88-9d66-39e8a0bd8b89 |
[shaunmulligan] This issue has attached support thread https://jel.ly.fish/c57bcf60-6609-4daa-86d1-91bf7fe1c56f |
[xginn8] This issue has attached support thread https://jel.ly.fish/f789d0eb-2d55-42bb-ba94-0b03bc112401 |
A user has provided a description of what seems to be the current cause of this issue.
@xginn8 looked into how we are retrieving the memory usage of the device and had the following to say:
Therefore, we should see if this module is calculating with the cached memory. Personally, unless this module is adding a more robust way of gathering system information that we are using in other places I'm in favour of us creating our own implementation to remove this 3rd party dependency but I haven't seen how much we use it. |
This is pretty well outlined in the kernel manpage: https://man7.org/linux/man-pages/man5/proc.5.html |
The memory information reported by the supervisor currently estimates the value of used memory as `MemTotal - MemFree`. However, linux systems will try to cache and buffer as much memory as possible, which will affect the output of `MemFree` (from /proc/meminfo) and in consequence the memory usage seen by the user on the dashboard, which will appear much greater than it is. The correct calculation should be `MemTotal - MemFree - Buffers - Cached`, which the calculation performed by `htop` and the `free` commands. Change-type: patch Signed-off-by: Felipe Lalanne <felipe@balena.io> Connects-to: #1471
The memory information reported by the supervisor currently estimates the value of used memory as `MemTotal - MemFree`. However, linux systems will try to cache and buffer as much memory as possible, which will affect the output of `MemFree` (from /proc/meminfo) and in consequence the memory usage seen by the user on the dashboard, which will appear much greater than it is. The correct calculation should be `MemTotal - MemFree - Buffers - Cached`, which the calculation performed by `htop` and the `free` commands. Change-type: patch Signed-off-by: Felipe Lalanne <felipe@balena.io> Connects-to: #1471
The memory information reported by the supervisor currently estimates the value of used memory as `MemTotal - MemFree`. However, linux systems will try to cache and buffer as much memory as possible, which will affect the output of `MemFree` (from /proc/meminfo) and in consequence the memory usage seen by the user on the dashboard, which will appear much greater than it is. The correct calculation should be `MemTotal - MemFree - Buffers - Cached`, which the calculation performed by `htop` and the `free` commands. Change-type: patch Signed-off-by: Felipe Lalanne <felipe@balena.io> Connects-to: #1471
[shaunmulligan] This issue has attached support thread https://jel.ly.fish/c30f67dc-d242-465b-a999-070f83552a36 |
[tmigone] This issue has attached support thread https://jel.ly.fish/073ce7d0-232c-401b-8438-d55c366880e5 |
When running node containers, dashboard RAM usage shows a different value that what is reported by the
top
andbalena stats
commands.In a reported case for a rpi3, the dashboard and the
free
command show 700MB in use, whiletop
andbalena stats
show 200MB usage.This requires further investigation to find the source of truth of memory usage and report the correct value to the user.
The text was updated successfully, but these errors were encountered: