Hi, my Sidekiq service was failing with Redis::CommandError (ERR max number of clients reached), so I ran INFO via the Redis CLI and it shows maxclients:25.
The pricing page indicates that my free Redis service should have a max of 50 connections. Are the “max number of clients” the same thing as Render’s “connection limit”? Should the maxclients be 50?
I am trying to understand the connections and clients for my Redis instance so that I may better configure Sidekiq.
I’m not seeing the same on a newly provisioned Redis free plan in my personal account.
It does seem we increased the connection limits just before Redis on Render was made generally available, was your Redis instance created during early access?
I’m still curious, does each call to Redis from either a Rails web service or Sidekiq background worker establish a new connection? Or is there any detailed Render-Redis documentation that could help me understand how it works (beyond what is publicly available)? I thought that my Rails app was a single client/connection, and the Sidekiq was another, and my local database client connecting externally was another.
I can push some code to test this theory in the meantime. I think I’ll still need to update my Sidekiq configuration to do some connection pooling. Maybe even my Rails app, which uses the new Kredis gem in several spots. Actually, since my Rails app uses Kredis more as a cache, and Sidekiq uses Redis as a queue, it sounds like I’ll need two Redis instance, each with a different eviction policy.
And it looks like it will warn if you set you pool too small for your configured concurrency:
def verify_sizing(size, concurrency) raise ArgumentError, "Your Redis connection pool is too small for Sidekiq. Your pool has #{size} connections but must have at least #{concurrency + 2}" if size < (concurrency + 2)end
So concurrency + 2 appears to be a bare minimum.
Load testing an app would be one way to highlight any connection limit issues.