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

Performance Profiling #753

Merged
merged 1 commit into from
Feb 21, 2025
Merged

Performance Profiling #753

merged 1 commit into from
Feb 21, 2025

Conversation

coreyogburn
Copy link
Contributor

This single file is only included in the build if the "debug" build flag is specified so by default the /debug/pprof endpoints are excluded from the build.

When included, this not only attaches the /debug/pprof endpoints, but this also provides a new middleware we can apply to endpoints in the app so that any calls to that endpoint will result in a cpu profile (and optional memory profile) being generated in your /tmp folder.

These tools are for the devs and should not make it into a production release. Although the performance impact of such an endpoint being released would be negligible, the security implications of somebody accessing the memory of a running service are too great to just add auth to the endpoint. This and it's accompanying Cypress test are designed to ensure there will not be any debug or pprof code in the binary coming out of CI/CD.

This single file is only included in the build if the "debug" build flag is specified so by default the /debug/pprof endpoints are excluded from the build.

When included, this not only attaches the /debug/pprof endpoints, but this also provides a new middleware we can apply to endpoints in the app so that any calls to that endpoint will result in a cpu profile (and optional memory profile) being generated in your /tmp folder.

These tools are for the devs and should not make it into a production release. Although the performance impact of such an endpoint being released would be negligible, the security implications of somebody accessing the memory of a running service are too great to just add auth to the endpoint. This and it's accompanying Cypress test are designed to ensure there will not be any debug or pprof code in the binary coming out of CI/CD.
@coreyogburn coreyogburn merged commit c9ed6ae into 2.4/dev Feb 21, 2025
3 checks passed
@coreyogburn coreyogburn deleted the cogburn/pprof branch February 21, 2025 18:07
@github-actions github-actions bot locked and limited conversation to collaborators Feb 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants