I have a procfile on my Heroku system designed to allow me to scale workers. The problem I have is that I want to scale workers not known about at the time of writing. Ie I can’t hard code them.
I want to be able to create a new worker type on the fly on Heroku.
I want to have a worker per client. Or perhaps many workers for a client that has a heavier load.
Each client pays for their own worker.
All examples of the proc file have three different queues “normal”, “priority”.
What I want though is different queues per client.
“client_1”, “client_2”, “client_3″….
I suppose I could build a procfile with 2000 entries… but that feels ugly.
Okay.. so my question.
Can I have my rails app modify the procfile, during run time? Add new lines to account for new clients?
No, Heroku doesn’t support specifying new process types dynamically.
However, are you sure that’s really what you want to do? Why does each client need a different queue? If you leave a worker process running, it will perform jobs for any client that requests them. If you’re trying to segregate client environments, maybe multiple apps are a better solution?