ruby on rails - Multi sidekiq processes for one application -
i have rails project using sidekiq. in project, want have multiple sidekiq processes. example, 1 normal sidekiq process (allow many concurrent workers) , 1 synchronous sidekiq process (allow 1 worker). here setting:
here normal sidekiq process:
--- :logfile: ./log/sidekiq.log :queues: - [important, 4] - [default, 2] - [low, 1]
here synchronous sidekiq process:
--- :logfile: ./log/sidekiq.log :queues: - long_running
i start 2 sidekiq processes using following commands:
bundle exec sidekiq -c config/sidekiq.yml -c 4 bundle exec sidekiq -c config/sidekiq_synchronous.yml -c 1
finally here sidekiq configuration in rails:
sidekiq.configure_server |config| config.redis = { url: env['redis_url'] } config.on(:startup) scheduled_set = sidekiq::scheduledset.new end end sidekiq.configure_client |config| config.redis = { url: env['redis_url'] } end sidekiq.default_worker_options = { retry: false }
it looks sidekiq use sidekiq.yml
default configuration. don't know how configure sidekiq using both 2 processes.
Comments
Post a Comment