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

couldn't record ruby subprocess #54

Open
Willis0826 opened this issue May 15, 2021 · 0 comments
Open

couldn't record ruby subprocess #54

Willis0826 opened this issue May 15, 2021 · 0 comments

Comments

@Willis0826
Copy link

Hi, I would like to record a flame graph with ruby application running with unicorn_rails. However, the flame graph seems only record the master process.

Currently, the running processes likes below:

$ ps aux

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   4288   768 ?        Ss   Apr22   0:00 sh -c ./start.sh
root         9  0.0  1.2 399664 192104 ?       Sl   Apr22   0:14 unicorn_rails master -c config/unicorn.rb
root      4741  0.1  1.3 551768 202820 ?       Sl   06:36   0:01 unicorn_rails worker[6] -c config/unicorn.rb
root      4939  0.1  1.2 752732 199644 ?       Sl   06:40   0:01 unicorn_rails worker[5] -c config/unicorn.rb
root      4978  0.1  1.3 552028 201684 ?       Sl   06:40   0:01 unicorn_rails worker[2] -c config/unicorn.rb
root      5005  0.1  1.2 551712 199332 ?       Sl   06:40   0:01 unicorn_rails worker[0] -c config/unicorn.rb
root      5152  0.2  1.3 822852 201480 ?       Sl   06:43   0:01 unicorn_rails worker[4] -c config/unicorn.rb
root      5171  0.1  1.2 551804 199864 ?       Sl   06:43   0:01 unicorn_rails worker[7] -c config/unicorn.rb
root      5193  0.1  1.2 552108 195444 ?       Sl   06:43   0:01 unicorn_rails worker[1] -c config/unicorn.rb
root      5397  0.0  1.1 399664 182352 ?       Sl   06:55   0:00 unicorn_rails worker[3] -c config/unicorn.rb

I run the following command to record the flame graph but the flame graph only record the master process.

$ kubectl flame my-app -t 1m --lang ruby -f flamegraph.svg

Also, I tried the rbspy with --subprocesses flag and the flame graph can record all the worker process correctly.

$ ./rbspy record --duration 60 --pid 9 --subprocesses

Therefore, I'm thinking if we need to set the --subprocesses flag in agent/profiler/ruby.go line 31 to make it able to record all the subprocess. Thanks!

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

No branches or pull requests

1 participant