Skip to content
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

Avoid metric lookup in Parallelizer.Until on every work piece #116428

Merged
merged 1 commit into from
Mar 9, 2023

Conversation

mborsz
Copy link
Member

@mborsz mborsz commented Mar 9, 2023

In #116427 we see that the WithLabelValues generates visible CPU load in scheduler.

Let's move it outside so that we don't lookup on each work piece.

/assign @alculquicondor
/kind bug
/sig scheduling

Fixed a 1.26 performance regression in scheduler caused by frequent metric lookup on critical code path.

Fixes #116427

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Mar 9, 2023
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 9, 2023
@alculquicondor
Copy link
Member

Add: Fixes #116427
in the description

@alculquicondor
Copy link
Member

/kind bug
/kind regression
/priority critical-urgent

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. and removed do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Mar 9, 2023
@alculquicondor
Copy link
Member

Getting rid of defer to reduce all unnecessary overhead. We don't use recover in kube-scheduler.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 9, 2023
@alculquicondor
Copy link
Member

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 9, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 0f6c874adb4bca50137c09234d367a822a85b97d

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor, mborsz

The full list of commands accepted by this bot can be found here.

The pull request process is described 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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 9, 2023
@mborsz mborsz changed the title Avoid metric lookup in Parallelizer.Util on every work piece Avoid metric lookup in Parallelizer.Until on every work piece Mar 9, 2023
@mborsz
Copy link
Member Author

mborsz commented Mar 9, 2023

/retest

1 similar comment
@mborsz
Copy link
Member Author

mborsz commented Mar 9, 2023

/retest

@k8s-ci-robot k8s-ci-robot merged commit c67953a into kubernetes:master Mar 9, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.27 milestone Mar 9, 2023
k8s-ci-robot added a commit that referenced this pull request Mar 11, 2023
…of-#116428-upstream-release-1.26

Automated cherry pick of #116428: Avoid metric lookup in Parallelizer.Until on every work piece
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance degradation in scheduler with additional metrics for tracking go-routines
3 participants