fhwang.net

redis

The nuts-and-bolts of configuring Resque and resque-web for a production Rails app

At Profitably, we’ve been using Resque for a few months now, and we’re loving it. Resque’s web interface is a great way to get a high-level understanding of your background workers, and its pluggable design has made it easy for others to contribute a number of really useful plugins. For Profitably, getting control of our background jobs is critical. Our software doesn’t have a ton of public-facing controllers & actions yet, but under the water line it’s already a large system built around mapping and aggregating financial data. (If you’re a Rubyist, and this sounds interesting to you, you should check out our jobs page.)

From a code perspective, it’s not that hard to move to Resque—you write Job classes and you just run them. But I found that I had a few speedbumps in setting it up for production, not least because configuration is not my strong suit. So I decided to describe how we configured Resque to run in production. There are a lot of duct-tapey parts to our setup, and it’s quite likely you’ll make some different choices, but what I describe below has worked well for us so far.

Build a resque-web directory in your Rails app

Continue reading “The nuts-and-bolts of configuring Resque and resque-web for a production Rails app” »

Testing Rails against a running Redis instance (and doing it with Hydra to boot)

Profitably has been running Redis since very early on. And as I’m planning to lean on Redis even more heavily going forward, particularly for Resque, I decided to beef up how Redis is tested in the Rails app. Since not a lot of people are talking about what this takes, here are my notes about my initial setup:

Testing approaches

If your Rails app uses Redis, there are basically three approaches you can take for when the code under test hits Redis.

Continue reading “Testing Rails against a running Redis instance (and doing it with Hydra to boot)” »