ruby on rails - Use multiple Redis servers in Sidekiq -
i using sidekiq
process background jobs 1 of our rails project. want use different redis server located @ different location sepearate out reportdb
other background processing job.
according sidekiq config wiki can configure like
config/initializers/sidekiq.rb
sidekiq.configure_server |config| config.redis = { :url => 'redis://redis.example.com:7372/12', :namespace => 'mynamespace' } end sidekiq.configure_client |config| config.redis = { :url => 'redis://redis.example.com:7372/12', :namespace => 'mynamespace' } end
but how can initialise connection multiple redis server?
sidekiq 2 doesn't support multiple redis servers, upgrade sidekiq 3 released today , adds new client sharding feature need.
from: sidekiq 3 release note
client sharding
sidekiq 2.x has scalability limit: 1 redis server. in practice limit greater 5000 jobs per second on hardware wasn’t big deal of more intense sidekiq users hitting limit. updated (sidekiq 3) sidekiq::client api allows specify redis connection pool use, rather assuming sidekiq.redis global pool previously, allowing target different types of jobs different redis servers. can scale sidekiq infinity , beyond!
the api entirely backwards compatible: the breaking change in client-side middleware. see upgrade notes more detail.
===
also take @ answer - work 2 separate redis instances sidekiq?
Comments
Post a Comment