Harikrishnan
Harikrishnan

Reputation: 94

Sidekiq with multiple instances with different queue using same redis server

Recently had to prioritize my Sidekiq queues (before I was using only the default queue). so, i thought of using reserved queues as per https://github.com/mperham/sidekiq/wiki/Advanced-Options#reserved-queues

config/sidekiq.yml contents:

---
:concurrency: 25
:logfile: ./log/sidekiq.log
:queues:
  - default
  - mailers

config/sidekiq_critical.yml contents:

---
:concurrency: 10
:logfile: ./log/sidekiq.log
:queues:
  - critical

in development environment, I can able to start 2 side instances with different config files as below

sidekiq -C config/sidekiq.yml
sidekiq -C config/sidekiq_critical.yml

I can able to see both sidekiq instances with different queues in sidekiq ui

I don't know how to run similar way in production environment. For production we are using similar as of mentioned in https://github.com/mperham/sidekiq/tree/master/examples/upstart

sidekiq.conf contents

script
exec /bin/bash <<'EOT'
  sudo -i -u ec2-deploy
  cd path/to/app
  RAILS_ENV=production bundle exec sidekiq -C config/sidekiq.yml
  RAILS_ENV=production bundle exec sidekiq -C config/sidekiq_critical.yml
EOT
end script

But i can able to see only one instance of sidekiq is running with config/sidekiq.yml queues.

Please help how to do run two sidekiq instances with different config files in the same server

Upvotes: 2

Views: 3174

Answers (1)

Mike Perham
Mike Perham

Reputation: 22208

You'd create a sidekiq2.conf. Or sidekiq-critical.conf. Or any name you want.

Upvotes: 3

Related Questions