HA for Resque & Redis

Posted by Chris Go on Server Fault See other posts from Server Fault or by Chris Go
Published on 2013-06-28T02:31:12Z Indexed on 2013/06/28 4:22 UTC
Read the original article Hit count: 554

Filed under:
|
|

Trying to avoid SPOFs for Resque and Redis. Ultimately the client is going to be PHP via (https://github.com/chrisboulton/php-resque). After going through and finding some workable HA for nginx+php-fpm and MySQL (mysql master-master setup as a way to simply master-slave promotion), next up is Resque+Redis.

Standard install of Resque uses localhost Redis (at DigitalOcean). I am heavily depending on Amazon Route 53 DNS failover to try to solve this.

resque1.domain.com points to localhost redis (redis1.domain.com) => same server resque2.domain.com points to localhost redis (redis2.domain.com) => same server

Do resque.domain.com with FAILOVER resque1 as primary and resque2 as secondary. What this means is that most of the time (99%), resque1 should be getting hit with resque2 as just a hot backup.

This lets me just have to get 2 servers and makes sure that any hits to resque.domain.com goes somewhere


The other way to do this is to break out resque and redis into 4 servers and do it as follows

resque1.domain.com -> redis.domain.com resque2.domain.com -> redis.domain.com redis1.domain.com redis2.domain.com

Then setup DNS Failover

resque.domain.com -> primary: resque1 and secondary: resque2 redis.domain.com -> primary: redis1 and secondary: redis2

I'd like to get away for 2 servers if I can but is this 2nd setup much better or negligible?

Thanks, Chris

© Server Fault or respective owner

Related posts about php5

Related posts about redis