Skip to content

Configured clustered rated limiters #6288

Answered by mperham
steveh asked this question in Q&A
Discussion options

You must be logged in to vote

Right, the redis config assumes you want a pool of basic redis-client instances. Sidekiq isn't cluster-compatible so Sidekiq::Config::redis= doesn't allow :nodes but Sidekiq::Limiter needs a spot of logic to allow cluster-compatibility.

Put this monkeypatch at the top of your app's initializer with the simple Hash config below it and let me know if it solves your problem.

module Sidekiq
  class RedisClientAdapter
    def initialize(options)
      opts = client_opts(options)
      @config = if opts.key?(:sentinels)
        RedisClient.sentinel(**opts)
      elsif opts.key?(:nodes)
        # Sidekiq does not support Redis clustering but Sidekiq Enterprise's
        # rate limiters are clust…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@mperham
Comment options

@steveh
Comment options

@mperham
Comment options

@steveh
Comment options

@mperham
Comment options

Answer selected by steveh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants