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

profiling: higher memory sampling rate #11308

Merged
merged 1 commit into from
Aug 23, 2021

Conversation

vrothberg
Copy link
Member

@vrothberg vrothberg commented Aug 23, 2021

Increase the memory-sampling rate to the same default as
github.com/pkg/profile. Allow for custom rates by reading
the MemProfileRate env variable.

Signed-off-by: Valentin Rothberg [email protected]

@mheon @baude PTAL

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 23, 2021
}
}
if cmd.Flag("memory-profile").Changed {
// Same value as the default in github.com/pkg/profile.
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't there be a similar os.Create(cfs.MemoryProfile) be here as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's happening below in the pre-stop hook. The CPU profile is created at the beginning an continuously being written to while the memory profile is created at the very end with all samples.

Copy link
Member

Choose a reason for hiding this comment

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

What happens if the file can not be created? I would prefer to know early rather then run my entire test and have it blow up in the end?

Copy link
Member Author

Choose a reason for hiding this comment

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

It'll blow up at the end. There's not much we can do, since the memory profile must be written at the end. It's just how the stdlib wants it.

Note that the flag is hidden and meant to be only used by the devs.

Copy link
Member

Choose a reason for hiding this comment

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

Ok.
LGTM

@mheon
Copy link
Member

mheon commented Aug 23, 2021

/lgtm
/approve
/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 23, 2021
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 23, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 23, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mheon, vrothberg

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

Increase the memory-sampling rate to the same default as
github.com/pkg/profile.  Allow for custom rates by reading
the `MemProfileRate` env variable.

[NO TESTS NEEDED] since it's a dev only flag and not part of CI.

Signed-off-by: Valentin Rothberg <[email protected]>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 23, 2021
@baude
Copy link
Member

baude commented Aug 23, 2021

/hold cancel
/lgtm

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 23, 2021
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 23, 2021
@openshift-merge-robot openshift-merge-robot merged commit f9d706b into containers:main Aug 23, 2021
@vrothberg vrothberg deleted the profiling branch August 24, 2021 08:06
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants