-
Notifications
You must be signed in to change notification settings - Fork 971
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
feat(env): Add automatic memory limit handling and move automaxprocs to pkg/util package #3806
base: master
Are you sure you want to change the base?
feat(env): Add automatic memory limit handling and move automaxprocs to pkg/util package #3806
Conversation
Signed-off-by: dongjiang1989 <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: dongjiang1989 <[email protected]>
Signed-off-by: dongjiang1989 <[email protected]>
Signed-off-by: dongjiang1989 <[email protected]>
Maybe java GC, Please re-run fail action, thanks |
you can close and reopen this PR to re-run the CIs |
Can you support more information about why these are needed? |
Thanks. Add information done. |
Welcome! just a little doubt here:
|
Thanks @Monokaix
|
Signed-off-by: dongjiang1989 <[email protected]>
/ok-to-test |
@dongjiang1989: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/assign @shinytang6 |
Is your feature request related to a problem?
It is good practice to set the Go runtime environment variables GOMAXPROCS and GOMEMLIMIT, which tell Go the max threads/memory it should use. We should set these in our containers that run Go (namely gloo and discovery) whenever resource limits are set.
Automatically set GOMEMLIMIT to match Linux cgroups(7) memory limit.
See:
https://pkg.go.dev/runtime
https://blog.howardjohn.info/posts/gomaxprocs/
https://github.com/KimMachineGun/automemlimit/
Describe the solution you'd like
automaxprocs
topkg/util
packageResult
My conclusion from the kubernetes cluster, is it that setting the GOMEMLIMIT equal to the memory limit has the following advantages: