external-dns icon indicating copy to clipboard operation
external-dns copied to clipboard

feat(env): auto set GOMAXPROCS

Open dongjiang1989 opened this issue 1 year ago • 10 comments

Description

Auto set GOMAXPROCS. add dependency on go.uber.org/automaxprocs

Checklist

  • [ ] Unit tests updated
  • [ ] End user documentation updated

dongjiang1989 avatar Jun 19 '24 02:06 dongjiang1989

[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.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Jun 19 '24 02:06 k8s-ci-robot

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.

k8s-ci-robot avatar Jun 19 '24 02:06 k8s-ci-robot

/ok-to-test

dongjiang1989 avatar Jun 19 '24 03:06 dongjiang1989

@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.

k8s-ci-robot avatar Jun 19 '24 03:06 k8s-ci-robot

@mloiseleur PTAL

dongjiang1989 avatar Jun 19 '24 06:06 dongjiang1989

I have mixed feeling with this PR. This kind of optimization should be done by either the language or the admin.

mloiseleur avatar Jun 19 '24 07:06 mloiseleur

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 avatar Jun 19 '24 10:06 dongjiang1989

@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.

szuecs avatar Jun 19 '24 14:06 szuecs

@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.

dongjiang1989 avatar Jun 20 '24 01:06 dongjiang1989

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.

mloiseleur avatar Jun 20 '24 07:06 mloiseleur

Thanks for this contribution. We won't put this into external-dns. This should be configured during deployment. /close

mloiseleur avatar Aug 10 '24 07:08 mloiseleur

@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.

k8s-ci-robot avatar Aug 10 '24 07:08 k8s-ci-robot