3 ms·
I'm really wondering how SO uses Redis. For example, how failure scenarios handled and what is the role of slaves.
by import 12y ago
I'm really wondering how SO uses Redis.
For example, how failure scenarios handled and what is the role of slaves.
- daigoba66 12y agoI've asked, and gotten an answer: http://meta.stackexchange.com/questions/248446/how-does-stack-exchange-achieve-high-availability-with-redis http://meta.stackexchange.com/questions/248446/how-does-stac... Other discussions: http://meta.stackexchange.com/questions/69164/does-stack-overflow-use-caching-and-if-so-how/69172#69172 http://meta.stackexchange.com/questions/69164/does-stack-ove... http://meta.stackexchange.com/questions/110320/stack-overflow-db-performance-and-redis-cache http://meta.stackexchange.com/questions/110320/stack-overflo...
- Nick-Craver 12y agoWe have a hot slave at all times for all instances. In the event of a failure the second slave will kick in. All applications are already connected to both servers via the StackExchange.Redis (https://github.com/StackExchange/StackExchange.Redis https://github.com/StackExchange/StackExchange.Redis) library. The mechanisms for failover, etc. are built in there. We use this library via the dashboard (pictured at the bottom of the post) in Opserver (https://github.com/opserver/Opserver https://github.com/opserver/Opserver) to do quick swapping of master/slave, etc. We can do this during the day without anyone noticing. Slaves are not just for backups - they also serve as pub/sub mechanisms. Every publish propagates to slaves. Since we use pub/sub for things like web sockets, we can easily move that entire concurrent connection load to another data center with a simple DNS change. Yep, we've tested this - it worked well. It is of course noting: redis just doesn't fail. We had one out of memory fail for the Q&A web sites when forking and that's it. It has been rock solid here.