Question

I know there have been a few posts on Heroku and delayed_job but I am still confused on the interaction between Heroku's workers and background jobs.

So I am launching a new version of my website and I added delayed_job to handle emails. It says that I just add worker: bundle exec rake jobs:work to my Procfile and I am good to go. But wouldn't that mean that the only worker I am paying for is being use for background jobs? So do I need to get another one then?

Some people also mentioned things like hirefire, which can automatically turn on and off your worker, but that doesn't make perfect sense to me. Shouldn't that worker always be doing stuff for your website already, so if it is ever in use with delayed_job then it isn't running my website. I have a low level of knowledge on how this all works and would love an explanation.

No correct solution

OTHER TIPS

Yeah in order to use delayed_job you need to be paying for one worker process. The worker process will only process your delayed_jobs from the queue, and then your normal web process (they give you one for free) will process all of your web requests. You scale web and worker processes separately.

A heroku ps will show you which processes you have running and you should have at least 1 web and at least 1 worker in order to process web requests and delayed job processes.

You can either use the command line or the web interface to add processes, command line to add your worker would be:

heroku ps:scale worker=1

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top