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

profiler: don't upload full profiles if delta profiling is enabled #1187

Merged
merged 3 commits into from Mar 1, 2022

Conversation

nsrip-dd
Copy link
Contributor

The full heap, mutex, and block profiles are not needed when delta profiling is enabled. Removing them (especially the full heap profile) results in a significant bandwidth and storage cost reduction.

I have tested actually uploading profiles with this change (using a Datadog free trial) and can confirm that continuous profiling still works as expected. I can access the heap, block, and mutex profiles like normal. I just don't get "heap.pprof", etc. when I download the profiles.

The full heap, mutex, and block profiles are not needed when delta
profiling is enabled. Removing them (especially the full heap profile)
results in a significant bandwidth and storage cost reduction.
@nsrip-dd nsrip-dd requested a review from a team as a code owner February 28, 2022 18:22
@nsrip-dd nsrip-dd added this to the 1.37.0 milestone Feb 28, 2022
felixge
felixge previously approved these changes Mar 1, 2022
Copy link
Member

@felixge felixge left a comment

Choose a reason for hiding this comment

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

LGTM! I'm okay if you don't make changes based on my NIT suggestions, but please verify if my predicate invariant analysis is correct or not. 🙇‍♂️

profiler/profile.go Outdated Show resolved Hide resolved
profiler/profile.go Outdated Show resolved Hide resolved
Removed a redundant condition (deltaProfile is documented to return nil
if delta profiles are disabled) and changed the order of conditions to
match the default configuration (detla profiles first).
Copy link
Member

@felixge felixge left a comment

Choose a reason for hiding this comment

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

LGTM!

The only last thought I have is that:

func (p *profiler) runProfile(pt ProfileType) ([]*profile, error) {

Could probably be simplified to this now:

func (p *profiler) runProfile(pt ProfileType) (*profile, error) {

IIRC that's what the func signature looked like before I introduced delta profiles.

But I'm totally fine with doing that at some point in the future to keep this PR more tight and focused. 👍

@nsrip-dd nsrip-dd merged commit ebf57ee into v1 Mar 1, 2022
@nsrip-dd nsrip-dd deleted the nick.ripley/remove-full-heap-profile branch March 1, 2022 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants