Quick update: Ravelry runs on

An UPDATED 2010 post can be found here: http://codemonkey.ravelry.com/2010/03/24/ravelry-runs-on-2010

Just a little something to get the ol’ blog rolling again.

Last March, I wrote a tiny post that listed a few of the pieces that run Ravelry along with my opinion of each. Here is a update to that list. The biggest change? I’ve been running Phusion Passenger + Apache as application servers for the last several months.

As of March 2009, Ravelry runs on….

  • Ruby on Rails 2.2: Still love it.
  • Phusion Passenger: Replaced Thin/Mongrel. Passenger plus Ruby Enterprise Edition uses less memory, avoids memory leaks, and it spawns and retires Ruby processes as needed. I also like that you can get a fair amount of status and debugging information if you need it. It looks like Passenger is the new standard for Ruby deployment. The only downside? Hot deployments of new versions of the app were causing lots of trouble for me (Google Groups thread here). I ended up putting together a Capistrano script that removes each Passenger from load balancer, updates and stops/starts Apache once it is cold, puts it back into the loop, and moves on the the next app server.
  • nginx: Still rocks. fast, memory efficient, stable, trouble free. We’re running two now.
  • haproxy: Still rocks. I’m using it to load balance HTTP requests across Apaches and provide failover for search and another service.
  • Sphinx: Still love it. If your site has any search needs, you’ve got to try it.
  • beanstalkd: beanstalkd + a few simple Rails runner script daemons are my new solution for running background jobs and processing file uploads. This is a huge improvement over backgroundrb: much simpler, much more stable. I’ve never had a problem with beanstalkd. Background jobs used to be a very brittle part of our architecture and now I rarely think about them.
  • Percona MySQL 5.0.x build: MySQL 5 has been rock solid for me. MySQL 5.1 was not. I’ve been running MySQL 5.1 on my slaves and I’ve found that they do a better job of picking up replication after a restart or other problem. Although I’d love the fast index creation feature that the InnoDB plugin provides, I have no plans to upgrade the main database to 5.1. However, I would like to bump up to one of the newer OurDelta MySQL 5 builds.
  • Other stuff: I’m still very happy with Nagios for monitoring, Munin for perfomance graphs, Postfix for mail, Xen for virtualization, and Gentoo as my Linux of choice.

Updated to add a little diagram that shows how the web/application tier fits together.

Comments (9)

  1. Thanks for this. I’m working on getting a Code Monkey Island-inspired blog going for Apartment Therapy. Soon, soon.

    Wednesday, March 11, 2009 at 1:31 pm #
  2. You are using nginx with phusion passenger? I thought apache was a requirement for that?


    Wednesday, March 11, 2009 at 4:39 pm #
  3. GinaC wrote:

    Whenever someone posts a link to their page on Ravelry…it now takes you to that new job description!! I’ve clicked on several links that Ravelers have posted, as they wanted to take you to ‘their’ page…but each time now all roads lead to the job description and want-ad for Community Support person. No doubt, several other people have mentioned this, but that drawn-in person actually looks a lot like me, except for about 150 pounds of flesh…perhaps I should consider applying. In the meantime it would be great if you’re able to help with the problem of all outside Ravelry links now leading to the job ad rather than to the Raveler’s page. In advance, thanks for your help! …gcor

    Sunday, March 22, 2009 at 5:34 pm #
  4. Scott T. wrote:

    Brian, Phusion runs on Apache. From the diagram, it looks like Casey has nginx out on port 80 then routes requests via haproxy to a cluster of Apaches running Phusion. I’m guessing nginx might also be delivering static or non-Rails content as well?

    Casey, what are you doing for asset hosting? All in house? CDN? S3? Have you looked into CDN services or reverse proxy cache (e.g., Varnish)? Or is that not a big enough problem for you yet? 🙂

    Sunday, March 22, 2009 at 10:14 pm #
  5. Jauder Ho wrote:

    Have you looked at the ey-balancer patch for nginx?

    It’s essentially a port of the haproxy maxconn code to nginx.


    Friday, April 17, 2009 at 5:49 pm #
  6. Lorenz wrote:

    Hi! I’ve been reading about your site on news.ycombinator.com and am fascinated by how much you achieved as just one programmer.

    Can you tell me what forum software you use on ravelry? Or did you code that from the ground up?

    Thursday, September 24, 2009 at 7:55 am #
  7. Manu wrote:

    Can you share your capistrano rolling deployment config?

    Monday, October 12, 2009 at 7:46 pm #
  8. Casey wrote:

    Here is a quick Gist that shows how the rolling deploy works: http://gist.github.com/210236

    Wednesday, October 14, 2009 at 12:27 pm #
  9. KnitFriend wrote:

    This is a fun setup. Shoot me an email if you’d like some volunteer help!

    Saturday, October 31, 2009 at 6:17 pm #

Trackbacks/Pingbacks (2)

  1. Load Balancing < Code Monkey Island on Monday, April 13, 2009 at 9:35 pm

    […] – Spring 2009: We are not running Phusion Passenger / Apache instead of Thin. Everything else remains the […]

  2. Ravelry Runs On - 2010 -- Code Monkey Island on Wednesday, March 24, 2010 at 9:35 am

    […] I guess that it’s time for the 3rd annual “Ravelry Runs On” roundup. The last two were in March 2008 and March 2009. […]