karmada icon indicating copy to clipboard operation
karmada copied to clipboard

feat: add auto go maxprocs

Open dongjiang1989 opened this issue 10 months ago • 6 comments

What type of PR is this?

/kind feature What this PR does / why we need it: auto setting gomaxprocs

Which issue(s) this PR fixes: Fixes #

Special notes for your reviewer:

In Kubernetes env, the containers spec as follows:

  containers:
  - args:
    image: docker.io/karmada/karmada-scheduler:v1.12.2
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: "4" 
        memory: 8Gi
      requests:
        cpu: "4"
        memory: 8Gi

In Runtime Information of Prometheus:

GOMAXPROCS:  96   // The host CPUs number, I'd like to see the values of `containers.requests` 4

In this case, the Go program scheduling or GC pause may cost too long.

The library automaxprocs has solved the problem that Go programs cannot set GOMAXPROCS correctly in the case of Containers.

Does this PR introduce a user-facing change?:

auto setting gomaxprocs

dongjiang1989 avatar Jan 14 '25 12:01 dongjiang1989

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 10.81081% with 33 lines in your changes missing coverage. Please review.

Project coverage is 48.34%. Comparing base (446dbe9) to head (1e086f7). Report is 368 commits behind head on master.

Files with missing lines Patch % Lines
cmd/agent/app/agent.go 0.00% 3 Missing :warning:
cmd/aggregated-apiserver/app/options/options.go 0.00% 3 Missing :warning:
cmd/controller-manager/app/controllermanager.go 0.00% 3 Missing :warning:
cmd/descheduler/app/descheduler.go 0.00% 3 Missing :warning:
cmd/karmada-search/app/karmada-search.go 0.00% 3 Missing :warning:
cmd/metrics-adapter/app/options/options.go 0.00% 3 Missing :warning:
cmd/scheduler-estimator/app/scheduler-estimator.go 0.00% 3 Missing :warning:
cmd/scheduler/app/scheduler.go 0.00% 3 Missing :warning:
cmd/webhook/app/webhook.go 0.00% 3 Missing :warning:
operator/cmd/operator/app/operator.go 0.00% 3 Missing :warning:
... and 1 more

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6047      +/-   ##
==========================================
- Coverage   48.35%   48.34%   -0.01%     
==========================================
  Files         666      667       +1     
  Lines       54831    54879      +48     
==========================================
+ Hits        26513    26531      +18     
- Misses      26599    26627      +28     
- Partials     1719     1721       +2     
Flag Coverage Δ
unittests 48.34% <10.81%> (-0.01%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar Jan 14 '25 12:01 codecov-commenter

/assign

I will take a look, probably by this week.

also, appreciated if you can give us some background of this, especially why do you think it's necessary.

Thanks. Got it. Add notes done.

dongjiang1989 avatar Jan 15 '25 07:01 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 ask for approval from rainbowmango. 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

karmada-bot avatar Jan 16 '25 11:01 karmada-bot

I added this to the meeting agenda 2025-02-11, can we discuss this PR there, I hope to learn more background before moving forward. Is it accepted for you?

RainbowMango avatar Jan 21 '25 07:01 RainbowMango

I added this to the meeting agenda 2025-02-11, can we discuss this PR there, I hope to learn more background before moving forward. Is it accepted for you?

Of course, happy to explain it

dongjiang1989 avatar Feb 05 '25 12:02 dongjiang1989

Hi @dongjiang1989 Kindly ping~ The meeting is about to begin, I didn't see you at the meeting. The meeting ID is https://zoom.com/my/karmada.

RainbowMango avatar Feb 11 '25 06:02 RainbowMango