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

enable/disable profile at runtime #532

Closed
localvar opened this issue Mar 1, 2022 · 1 comment · Fixed by #543
Closed

enable/disable profile at runtime #532

localvar opened this issue Mar 1, 2022 · 1 comment · Fixed by #543

Comments

@localvar
Copy link
Collaborator

localvar commented Mar 1, 2022

Easegress could generate CPU & memory profiles for troubleshooting, but this feature can only be enabled from the configuration at startup.

However, some issues only happen after Easegress runs for a long time, if profiling is not enabled at first, it will be very hard to reproduce the issue.

So, we need to add new admin APIs to enable/disable profiles at runtime.

@samutamm samutamm self-assigned this Mar 8, 2022
@samutamm
Copy link
Contributor

samutamm commented Mar 8, 2022

This would be very useful for debugging memory or cpu issues!

I could work on this. The API could be following:

Path Method Description Data
/profile/ GET Get info of current CPU & memory profiling. For example, whether enabled and what's the path to file. -
/profile/start/cpu POST Start profiling CPU to given file. Path for CPU profile file.
/profile/stop/cpu POST Stops profiling and dumps the results to file. -
/profile/start/memory POST Start profiling memory to given file. Path to Memory profile file.
/profile/stop/memory POST Stop profiling and dumps results to file. -

The profiling logic already exists in https://github.com/megaease/easegress/blob/main/pkg/profile/profile.go and the endpoint methods above could use it to start and stop profiling.

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 a pull request may close this issue.

2 participants