cheprasov / php-redis-client

RedisClient is a fast, fully-functional and user-friendly client for Redis, optimized for performance. RedisClient supports the latest versions of Redis starting from 2.6 to 6.0
MIT License
127 stars 41 forks source link

No reads on replicas in our cluster #71

Closed JohnD87 closed 4 years ago

JohnD87 commented 5 years ago

Hello,

we are currently running an Elasticcache Redis Cluster with 3 shards and one read replica per shard. Everything is working fine and the replica takes over if one of the master shards fails. But: We have no reads on the read replicas. They are just there relicating the masters and waiting for one of them to fail.

This seems like a waste of ressources for me. Is there a way to change that and use the replicas for read requests?

Thank you!

cheprasov commented 4 years ago

Hi @JohnD87 Please see Redis documentation about Manual Failover here https://redis.io/topics/cluster-tutorial#manual-failover Also. I think, it is possible to write some wrapper over the redis client which will use slave servers for reads commands, or use another instance of the redis client with connection to slave servers. Please see more here https://redis.io/topics/replication