-
Notifications
You must be signed in to change notification settings - Fork 57
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
Support container CPU & memory limits #30
Comments
Interesting overlap here with my effective_limits crate: I would happily consume container info from sysinfo if it has it, or some container specific abstraction as well. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When running within a Docker container it is possible to get information about the CPU and memory limits from
/sys/fs/cgroup
.For example
/proc/meminfo
shows the memory information of the host machine, however/sys/fs/cgroup/memory/memory.limit_in_bytes
identifies exactly how much memory this container is allowed to allocate before being killed by the container runtime.Correspondingly
/proc/cpuinfo
shows information about all host CPUs, and not the number of cores that the container is limited to.Examples:
The text was updated successfully, but these errors were encountered: