Redis connection timeout even after upgrading to elasticache m4.xlarge We are facing connection timeout.Our cache size is hardly 1.5Gb.We have been using m4.large instance and there was around 150-200 connection to instance.We tried adding two read replicas and still there was no decrease.We tried to move to cluster unfortunately redis ruby client does not support clustering.What could be done
-
As you are using a hosted Redis service, I recommend contacting your provider's support for help in resolving this. – Itamar Haber Apr 11 '17 at 10:10
1 Answers
Redis is just as powerful as limited by design. It provides great performance with powerful operation and datatypes... but it is single threaded and monolithic by design, which means that no matter how many cores your box has, Redis will use only one. If your application demands more operations per second than a single Redis process can handle, your only choice is to shard the load among multiple Redis processes/servers.
Redis cluster handles this issue by itself, sharding the load internally by sacrificing some key features like pipelining and multikey operations but requires compatible client libraries.
Standard Redis provides two ways of scaling read capacity, but both require some effort in the client side: Read replicas and data sharding among multiple Redis masters (and read replicas for each master). In the first case you must balance your read operations between all of your replicas (many client libraries provide native support for this). In the second scenario, your application is responsible of the data sharding process and send traffic to each Redis "cluster" by evaluating distribution function before each operation.
Anyway, scaling read capacity with Redis is not a trivial task. I hope all of these options help to clarify.

- 1,179
- 8
- 15