external-dns
external-dns copied to clipboard
feat(env): auto set GOMAXPROCS
Description
Auto set GOMAXPROCS. add dependency on go.uber.org/automaxprocs
Checklist
- [ ] Unit tests updated
- [ ] End user documentation updated
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign mloiseleur for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Hi @dongjiang1989. Thanks for your PR.
I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
I understand the commands that are listed here.
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-sigs/prow repository.
/ok-to-test
@dongjiang1989: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/ok-to-test
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-sigs/prow repository.
@mloiseleur PTAL
I have mixed feeling with this PR. This kind of optimization should be done by either the language or the admin.
I have mixed feeling with this PR. This kind of optimization should be done by either the language or the admin.
Thanks for your review. @mloiseleur The containers to pick up the correct GOMAXPROCS based on the CPU resource limits. ref: https://pkg.go.dev/go.uber.org/automaxprocs?utm_source=godoc
@dongjiang1989 what do you try to fix? I don't see why we should add a dependency for a thing that is not important for control loops like external-dns.
@dongjiang1989 what do you try to fix? I don't see why we should add a dependency for a thing that is not important for control loops like external-dns.
As you all know node/pod come with different sizes. For example, we use quite huge nodes with up to 104 CPUs, we aren't able to set environment variables to set GOMAXPROCS to the value of cpu.limit. automaxprocs package does this automatically without any additional pain. If there are not limits specified, default value (number of cores) will be left in place.
we aren't able to set environment variables to set GOMAXPROCS to the value of cpu.limit
IMHO, this is the problem you should solve on your platform, not with external-dns source code.. You may also be interested to tune GOMEMLIMIT.
Thanks for this contribution. We won't put this into external-dns. This should be configured during deployment. /close
@mloiseleur: Closed this PR.
In response to this:
Thanks for this contribution. We won't put this into external-dns. This should be configured during deployment. /close
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-sigs/prow repository.