parca icon indicating copy to clipboard operation
parca copied to clipboard

feature: enable profile immediately.

Open zdyj3170101136 opened this issue 2 years ago • 4 comments

the go pprof provides an ui which enable us to start a cpu profile on service immediately. i think it make a lot of sense if we could profile a service immediatelly by using parca agent.

zdyj3170101136 avatar Sep 06 '22 12:09 zdyj3170101136

Can you elaborate a bit more on what "profile a service immediately" would mean and how you think that could fit with parca-agent? Thanks!

metalmatze avatar Sep 13 '22 09:09 metalmatze

for now, tha parca ui provide a target html, which enable we collector a profile immediately through go http pprof handler.

截屏2022-09-14 下午4 14 04

if the parca agent could provide an api: RPC profile(processID id, second time.Duration) ProfileRequest

and it will do cpu profile just like linux perf tool : perf --pid=processID -a -g sleep 10s

and parca ui add all process name,ip which parca agent could find use something like: ps -ef

the parca store profile data into it's persistent store instead of download to the user's filesystem.

so the parca could provide ability to sample cpu profile on any machine for any language process immediately.

zdyj3170101136 avatar Sep 14 '22 08:09 zdyj3170101136

Hey @zdyj3170101136, I am not sure I understand the request, it sounds like the idea would be to trigger+pull profiles by PID from the agent via an API? And maybe another API to list processes on the node? Basically, profile a selected process on-demand rather than continuously?

The upcoming 0.10 release of the agent will allow system-wide profiling, profiles for all running processes (filtering is planned: parca-dev/parca-agent#690) will be pushed to Parca: polarsignals.com/blog/posts/2022/08/24/system-wide-profiling

An update of the Agent UI is on its way: parca-dev/parca-agent#767. It happens to add back a /query endpoint, but I do not think there is any plan to use such endpoint in Parca at the moment. The endpoint does not trigger the creation of a profile, it waits for the next profile generated by the profiling loop and catches it before it is sent to Parca.

Though, there are 2 feature requests you might be interested in:

  • #939
  • parca-dev/parca-agent#250 (from the CLI)

maxbrunet avatar Sep 14 '22 18:09 maxbrunet

嘿@zdyj3170101136,我不确定我是否理解该请求,听起来这个想法是通过 API 从代理通过 PID触发+**拉取配置文件?**也许还有另一个 API 可以列出节点上的进程?基本上,按需而不是连续地分析选定的流程?

即将发布的 0.10 版代理将允许在系统范围内进行分析,所有正在运行的进程的配置文件(过滤计划:parca-dev/parca-agent#690)将被推送到 Parca:polarsignals.com/blog/posts/2022/ 08/24/系统范围的分析

代理 UI 的更新正在进行中:parca-dev/parca-agent#767。它恰好添加了一个/query端点,但我认为目前没有任何计划在 Parca 中使用这样的端点。端点不会触发配置文件的创建,它会等待分析循环生成的下一个配置文件并在将其发送到 Parca 之前将其捕获。

不过,您可能对以下 2 个功能请求感兴趣:

yes, trigger+pull profiles by PID from the agent via an API.

i know the parca-agent is support system-wide-profiling。

but provide an API is more freedom, the user could define when the perf was started and how long it run.

zdyj3170101136 avatar Sep 15 '22 03:09 zdyj3170101136

we had support immediately profiling base on parca.

here is a page which use can input ip, port and endpoint. 截屏2022-09-28 下午6 25 00

and then user could click on 'allocs', and then it redirect to parca ui.

截屏2022-09-28 下午6 26 23

zdyj3170101136 avatar Sep 28 '22 10:09 zdyj3170101136