Running delayed jobs on Heroku for free Running delayed jobs on Heroku for free heroku heroku

Running delayed jobs on Heroku for free


Splitting the process like that can incur problems - your best bet is it not try and get it 'free' but use something like http://hirefireapp.com/ which will start up a worker when there are jobs to perform reducing the cost significantly rather than running a worker 24x7.

Also note, Heroku will only ever autostart a 'web' process for you, starting other named processes is a manual task.


You can use Heroku Scheduler to run the jobs using the command

rake jobs:workoff

This way the jobs can run in your web dyno. According to Delayed_Job docs, this command will run all available jobs and exit.

You can configure the scheduler to run this command every 10 minutes for example, and it doesn't have sensible effect on the app's performance when no jobs are queued. Another good idea is to schedule it to run daily at a time with lower access rates.


Ideally there is no straight way to get this free, but you would find lots of workaround one can make to enjoy free background jobs. One of which is http://nofail.de/2011/07/heroku-cedar-background-jobs-for-free/

Also if you plan to use resque which is an excellent choice for background jobs you would need redis which comes free with nano version => https://addons.heroku.com/redistogo. https://devcenter.heroku.com/articles/queuing-ruby-resque

Simple solution is to buy a one dyno for the worker, whereas your web dyno would be free.

Let me if you need more help.

Thanks