I have a Rails 3 app hosted on heroku which at the moment has only one web and one worker dyno. I recently started using Redis as caching database too so I'm performing actions like this (using the redis-rb gem):
redis = Redis.new(:host => host, :port => port, :password => password)
redis.set("my_key", some_value)
Now I'm getting the following error on my heroku app:
enter code here
max number of clients reached
I understand that Redis.new will create a new client but I assumed that the connection would be released once the method has completed? Do I need to disconnect the client manually? I've tried redis.destroy & redis.delete but to no avail.
Thanks for any help with this.
The answer to this as it turns out is that, yes, the redis client has to be closed manually like so
redis.quit