Is there a simple way of knowing running Heroku processes from within a process?

215 Views Asked by At

I'd quite like to know whether there's a simple way of knowing the list of running processes in your app, from inside a running process.

For instance, let's say I have a web process and a worker process. From within the web process, can I know that I have 2 worker processes running?

1

There are 1 best solutions below

0
On BEST ANSWER

yes you can that by adding heroku Gem in your Gemfile.

and then running system commands from code. I have tried this on heroku bash

Running bash attached to terminal... up, run.1 ~ $ heroku ~ $ ~ $ heroku -v 2.25.0 ~ $ heroku ps

Process State Command


web ....

It will prompt for password so you can your heroku client class for login purpose and then listing all processes.

Hope this will help you.