-
Notifications
You must be signed in to change notification settings - Fork 758
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
Fix resource detection for unset CPU and memory limits in cgroup v2 #5267
Fix resource detection for unset CPU and memory limits in cgroup v2 #5267
Conversation
Address the issue where `/sys/fs/cgroup/cpu.max` and `/sys/fs/cgroup/memory.max` report "max", indicating unset limits in cgroup v2. Now, system resources (CPU cores and memory) are fetched directly from `/proc/stat` and `/proc/meminfo` limits are not set..
Unfortunately, this pull request does not fix either of the two issues.
|
@gitmln thanks for pointing that out. The PR was just a draft because i didn't have a real installation of Linux with cgroup v2 on which I could test it. |
@gitmln how does the current implementation look to you? |
@RussKie It looks perfect to me. This is the code that I've already thought about and tested successfully using a generic web app with mcr.microsoft.com/dotnet/runtime-deps:8.0 image on my AKS cluster. |
@gitmln thanks for checking. Do not hesitate to create a PR next time 😊 |
Thank you @mobratil |
Address the issue where
/sys/fs/cgroup/cpu.max
and/sys/fs/cgroup/memory.max
report "max", indicating unset limits in cgroup v2.Changes Made:
/sys/fs/cgroup/cpu.max
reads "max", the number of CPU cores is now derived from the host's/proc/stat
file./proc/meminfo
file if/sys/fs/cgroup/memory.max
contains "max".Microsoft Reviewers: Open in CodeFlow