0

I am running sidekiq workers task and using redis to go nano on heroku.

My sidekiq.yml looks like this:

Sidekiq.configure_client do |config|
    config.redis = {size: 1, db: 0, url: ENV["REDISTOGO_URL"] || 'redis://localhost:6379/0'}
end

Sidekiq.configure_server do |config|
    config.redis = {size: 3, db: 0, url: ENV["REDISTOGO_URL"] || 'redis://localhost:6379/0'}
end

When I am setting the size for server less than 7, it gives me the error :

Your redis connection pool is too low. Must be atleast 7 connection.

When I am setting it to 7, it's giving me

max number of clients reached.

I don't understand why is this error arising and how to solve this problem for heroku. What is the optimal number where neither error happens ?

Saurav Prakash
  • 1,177
  • 1
  • 11
  • 25
  • You have to fit in the [10 connections limit](https://elements.heroku.com/addons/redistogo). Assuming minimal pool on the server, you can afford 7 on the server and 3 on the client, and you won't be able to connect to it yourself for examination, should you ever need to. Also if you're using a forking webserver (clustered Puma or Unicorn), you'll get one pool of connections for every worker process. – D-side Feb 20 '18 at 01:57
  • I am not clear. I have one dedicated worker and one server. I have added redis to go nano heroku. So what should be my server and client sizes? – Saurav Prakash Feb 20 '18 at 08:55
  • You seem to be using "worker" and "server" in a different sense. Sidekiq is a client-server system, with clients sending jobs and servers executing them. Plus, certain web servers may spawn multiple processes for parallelism, they are called workers too. A typical use case is sending jobs from a web server via sidekiq client, so they are run on sidekiq server. Any clearer? – D-side Feb 23 '18 at 04:50

0 Answers0