Workarounds for un-containerized resource limits visible in containers
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 368
Description
Typical cases: `free` and `top` commands.
Some references:
- https://fabiokung.com/2014/03/13/memory-inside-linux-containers/
- https://ops.tips/blog/why-top-inside-container-wrong-memory/
Currently there is no way to change the information exposed by `/proc/meminfo` and `sysinfo()` system call without patching the Linux kernel manually.
Potential solutions:
- Wait until such well-known tools are updated to used `libmymem` which takes cgroup/rlimit into account when calculating available memory.
- Update our jail to override the content of `/proc/meminfo` and the result of `sysinfo()` system call.\* Currently overriding an arbitrary file content via jail is very tricky, since we need to emulate file I/O syscalls to work upon a custom-built buffer.
┆Issue is synchronized with this [Asana task](https://app.asana.com/0/1159751085623729/1159757054588980) by [Unito](https://www.unito.io/learn-more)
JIRA Issue: BA-320
Contributor guide
Research direction
Start by tracing the jail's handling of /proc/meminfo and sysinfo(), then compare free and top output with the container's cgroup and rlimit values. The issue proposes either libmymem-aware tools or jail-level overrides for these interfaces; determine which path is supported and validate the resulting command output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux
- Domain
- infrastructure, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100