3

I am currently running delayed::job on my Heroku instance for quite a few different types of jobs (exporting large lists etc.) and I'm using the awesome progress job gem that shows a progress bar of the job to the user who made the request.

I'd like to be able to run a sidekiq worker as well for other jobs, not involving the user, that I don't need a progress bar for, because of it's obvious memory improvements over Delayed::Job.

Is it possible for me to run both delayed job and sidekiq on the same heroku app? If so is there any examples I can follow? I'm confused on how I would setup the procfile or this.

Below is my Procfile. I don't see how to start both Delayed Job and Sidekiq? If I do something like just add bundle exec sidekiq on a worker line below, it seems to replace delayed job?

Procfile:

web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}
web: bundle exec puma -C config/puma.rb
worker: bundle exec rake jobs:work
Steve Q
  • 395
  • 5
  • 28

1 Answers1

3

It is possible.

First, You should solve similar interfaces conflict problem like .delay. here: Run Delayed Jobs and Sidekiq at the same time

Second, you should set multiple active_job adapter configuration. here: http://edgeguides.rubyonrails.org/active_job_basics.html#backends

About Procfile, You can register multiple worker For example)

web: bundle exec puma -t 5:5 -p ${PORT:-3000} -C config/puma.rb
worker: bundle exec sidekiq
delayedjobworker: bundle exec rake jobs:work

Check https://devcenter.heroku.com/articles/procfile#more-process-type-examples

Community
  • 1
  • 1
Jaehyun Shin
  • 1,562
  • 14
  • 25
  • Thank you for your help. Took me a little bit to get this setup. So I have it working with ActiveJob locally and fixed the delay problem, but I"m not sure how to get this setup on Heroku with my Procfile. It seems like it's one or the other? I edited my question to include the procfile. Could you take a look? – Steve Q Dec 13 '16 at 19:19