rbspy
rbspy copied to clipboard
non-interactive rootless on-demand profiling
there are environments where you do not have root, for example heroku. this means that it is not possible to attach to an existing pid. we could wrap the process creation in rbspy record
, but that (afaik) makes assumptions about being an interactive session and will record for the whole lifetime of the process.
i have no idea how feasible this is, but could there be some sort of rbspy record --non-interactive ruby fave.rb
that starts ruby
as a sub-process, but does not profile anything yet. the rbspy parent process could then be instructed to start profiling, either by sending a signal to it or via HTTP or a unix socket.
this is just a random idea i had, which may very well be outside of the scope of rbspy. and there are certainly other approaches that can be used in this scenario, like replaying production traffic into a less restrictive environment.
I think this is a great idea and I'd gladly accept contributions of something like this!