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

pull pprof: allow infrequent profiling #2818

Closed
redbaron opened this issue Mar 21, 2023 · 3 comments · Fixed by #4623
Closed

pull pprof: allow infrequent profiling #2818

redbaron opened this issue Mar 21, 2023 · 3 comments · Fixed by #4623

Comments

@redbaron
Copy link

redbaron commented Mar 21, 2023

currently there seem to be no way to have infrequent profiling, because scape interval is added as ?seconds param, making profiling continuous.

It would be nice if it was possible to specify custom seconds option. For a scrape_interval: 5m job I tried to create pprof_config with /debug/pprof/profile?seconds=3s path , but it had 2 problems:

  • ? got URLencoded, so it wasn't recognized by pprof server handler
  • all path from default parca pprof_config profile config are still present, including /debug/pprof/profile?seconds=300
@brancz
Copy link
Member

brancz commented Mar 21, 2023

For cpu profiling I would recommend to always profile using parca agent, it puts way less overhead on the workload so you can always do it.

That said I think this use case does make sense. How about we allow specifying a duration in the scrape config and if specified we use that rather than the scrape interval? Eg. here

# delta: true

What do you think?

@redbaron
Copy link
Author

For cpu profiling I would recommend to always profile using parca agent

Thats what I tried first, but it gave me odd symbol names, unlike native pprof. "shape" of the flamegraph was very similar though. Also agent doesn't seem to be offering off-cpu profiling. Having said that, even with pprof continuous profiling enabled CPU usage graph on a 1 minute resolution chart didn't have any noticeable change in my case.

What do you think?

this and disabling builtin config when pprof_config is provided would do the trick

@brancz
Copy link
Member

brancz commented Mar 21, 2023

It’s normal that the agent data looks slightly different. It’s actually good, because 1) the runtime hides some things in the “native” pprof profilers, and 2) it uses sigprof which potentially changes program flow. That said, if it looks suspicious we’d love to see it to be able to fix any bugs should there be any.

this and disabling builtin config when pprof_config is provided would do the trick

Agreed! Do you want to give it a try and implement it?

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