-
Notifications
You must be signed in to change notification settings - Fork 196
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 memory limit with croup #57
fix memory limit with croup #57
Conversation
@Nicholaswang thanks for you Pull Request, could you also add a test in: https://github.com/cloudfoundry/gosigar/blob/master/sigar_linux_test.go |
@Nicholaswang in its current form we won't be able to accept this PR? Would you be able the test as requested in the previous comment? |
Sorry for the message loss, I will extend the unit tests ASAP. |
Signed-off-by: Nicholaswang <wzhever@gmail.com>
@rkoster hi, unit tests have been extended |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me.
Yeah, this is definitely something we missed in the original work. Thanks much for the PR. Once you resolve the (For what it's worth, I'm not sure why we would ever use ================================================= For the benefit of others who might come across this PR in the future, this is what I did to validate that the reported problem is a problem and that the proposed solution is a good one:
|
. |
@klakin-pivotal @ramonskie for containers, could you explain why you picked |
Hello, @metonymic-smokey ! @andreas-kupries was the fellow who wrote that code, so he'd be most likely to be able to give you the best answer. However, the choice seemed reasonable to me when I merged in that code (in PR #50), and still seems reasonable today. I will attempt to justify the decision, and would appreciate corrections for any part that I get wrong. According to the documentation (https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html#memory-interface-files), exceeding
The documentation for
The documentation indicates that it is a bad thing to reach You might also find the explanation here to be informative: https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html#id1 Among other things, it describes the shortcomings of how cgroup v1 handled its high memory limit and why there's a good reason to use |
Hi. This is now long enough in the past that I honestly do not fully recall anymore.
|
Signed-off-by: Nicholaswang <wzhever@gmail.com>
Signed-off-by: Nicholaswang <wzhever@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
@Nicholaswang Thanks much for the PR, and taking the time to make the corrections I requested. I have squashed down the commits into a single commit and have written up a commit message that -hopefully- correctly describes the problem that the commit solves, and how it solves it. I do hope that you are not unhappy with the commit message. The commit has been merge into |
And we now have a release: https://github.com/cloudfoundry/gosigar/releases/tag/v1.3.4 |
use hierarchical_memory_limit of memory.stat instead of memory.limit_in_bytes since limit_in_bytes is often inherited from pod node and sometimes it's unlimited. hierarchical_memory_limit is more accurate.
