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

cl2: Scrape block profiles instead of mutex ones #2215

Merged

Conversation

MadhavJivrajani
Copy link
Contributor

@MadhavJivrajani MadhavJivrajani commented Dec 14, 2022

What type of PR is this?

/kind bug cleanup

What this PR does / why we need it:

In k/k, contention-profiling can be enabled using the --contention-profiling flag. However, this enables block profiling and not mutex profiling. CL2 as of now scrapes mutex profiles and not block profiles, because of which inspite of enabling contention profiling on control plane components, the profiles are still empty.

As seen here for the API Server, --contention-profiling enables block profiling:
https://github.com/kubernetes/kubernetes/blob/68f808e6db388b249dae8c6c9dfb078bc0947b49/staging/src/k8s.io/apiserver/pkg/server/config.go#L919-L920

and similarly for other components.

See slack discussion here.

In k/k, contention-profiling can be enabled using the
--contention-profiling flag. However, this enables block
profiling and not mutex profiling. CL2 as of now scrapes
mutex profiles and not block profiles, because of which
inspite of enabling contention profiling on control plane
components, the profiles are still empty.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 14, 2022
@MadhavJivrajani
Copy link
Contributor Author

/assign @marseel

@@ -218,26 +218,26 @@ func (t *testMetrics) Execute(config *measurement.Config) ([]measurement.Summary
appendResults(&summaries, errList, summary, executeError(t.etcdCPUProfile.String(), action, err))
summary, err = execute(t.etcdMemoryProfile, etcdGatherConfig)
appendResults(&summaries, errList, summary, executeError(t.etcdMemoryProfile.String(), action, err))
summary, err = execute(t.etcdMutexProfile, etcdGatherConfig)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@MadhavJivrajani MadhavJivrajani Dec 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah etcd actually enables both block and mutex:
https://github.com/etcd-io/etcd/blob/8e3fc380dcaf44c37bb5dc19f1832981225061cc/pkg/debugutil/pprof.go#L28 and https://github.com/etcd-io/etcd/blob/8e3fc380dcaf44c37bb5dc19f1832981225061cc/pkg/debugutil/pprof.go#L43

I think we may have to introduce a new type called BlockProfile, enable that for all control plane components and then use MutexProfile only for etcd if we want etcd mutex profiles

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, sounds good.

@marseel
Copy link
Member

marseel commented Dec 14, 2022

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MadhavJivrajani, marseel

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 Dec 14, 2022
@k8s-ci-robot k8s-ci-robot merged commit 1a1a8ef into kubernetes:master Dec 14, 2022
@MadhavJivrajani MadhavJivrajani deleted the scrape-block-profiles branch January 10, 2023 08:08
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/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants