-
Notifications
You must be signed in to change notification settings - Fork 883
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
skip calculate available replicas when no need #4574
base: master
Are you sure you want to change the base?
Conversation
[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 |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #4574 +/- ##
==========================================
+ Coverage 51.89% 53.07% +1.17%
==========================================
Files 246 251 +5
Lines 24329 20395 -3934
==========================================
- Hits 12625 10824 -1801
+ Misses 11017 8857 -2160
- Partials 687 714 +27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Well, I'm afraid not. This func will only be invoked when strategy is Aggregated or DynamicWeight which is necessay indeed. |
refer to karmada/pkg/scheduler/core/common.go Lines 32 to 38 in d508417
as you can see, the function GroupClustersWithScore is executed first, and then the function SelectBestClusters . And function GroupClustersWithScore will execute function calAvailableReplicas to calculate available replicas, no matter what the strategy is.
|
631ca2f
to
6b84629
Compare
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.
Other lgtm
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
6b84629
to
e1a71e5
Compare
/retest |
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
cc @Garrybest |
What type of PR is this?
/kind feature
What this PR does / why we need it:
When Karmada is scheduling, it will always invoke
calAvailableReplicas
to calculate available replicas, regardless of necessity, thereby increasing CPU overhead.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
NONE
Does this PR introduce a user-facing change?: