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

feat: support heap profiling #768

Merged
merged 1 commit into from
May 22, 2024
Merged

feat: support heap profiling #768

merged 1 commit into from
May 22, 2024

Conversation

flavio
Copy link
Member

@flavio flavio commented May 21, 2024

Support the generation of pprof profiles of heap usage by using jemalloc facilities.

This requires jemalloc to be configured with some special options, hence all the builds will have this settings enabled. This doesn't seem to cause performance regressions from what I've seen while doing load tests locally.

I've also added some instructions explaining how to memory and CPU profiling.

@flavio flavio self-assigned this May 21, 2024
@flavio flavio requested a review from a team as a code owner May 21, 2024 16:34
Copy link

codecov bot commented May 21, 2024

Codecov Report

Attention: Patch coverage is 0% with 32 lines in your changes are missing coverage. Please review.

Project coverage is 32.69%. Comparing base (890b9c7) to head (760a7bf).

Files Patch % Lines
src/api/handlers.rs 0.00% 19 Missing ⚠️
src/profiling.rs 0.00% 9 Missing ⚠️
src/lib.rs 0.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #768       +/-   ##
===========================================
- Coverage   57.61%   32.69%   -24.92%     
===========================================
  Files          16       15        -1     
  Lines         729      734        +5     
===========================================
- Hits          420      240      -180     
- Misses        309      494      +185     
Flag Coverage Δ
integration-tests ?
unit-tests 32.69% <0.00%> (-1.35%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jvanz jvanz left a comment

Choose a reason for hiding this comment

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

The changes looks good to me. But my personal preference is to enable this feature only when required using build time configs.

@flavio
Copy link
Member Author

flavio commented May 22, 2024

I've done the following changes:

  • jemalloc's pprof support is enabled by default, but is NOT active
  • when jemalloc's pprof is active there's a higher CPU usage
  • jemalloc's pprof is automatically activated when policy-server runs with --enable-pprof

@flavio flavio force-pushed the pprof-heap branch 2 times, most recently from cfafae7 to cd2db12 Compare May 22, 2024 09:18
Support the generation of pprof profiles of heap usage by using jemalloc
facilities.

Signed-off-by: Flavio Castelli <[email protected]>
@flavio flavio merged commit 4486f8d into main May 22, 2024
11 of 18 checks passed
@flavio flavio deleted the pprof-heap branch May 22, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants