Seesaw: An Improved Restart System for Mongrel
Most Rails developers will be familiar with *** ****'s Mongrel, a great HTTP library used by most Rails developers to either test or deploy their applications (it's also pretty great for building your own basic HTTP handlers too, but I digress).
Sometimes when restarting applications after code updates, some requests can be "lost" in the whole process, particularly in high-traffic environments. Seesaw, developed by Max Muermann and Matt Allen, however, resolves this problem by restarting your mongrel processes one by one so that availability is ensured. Seesaw is available as a gem (gem install seesaw), although this blog post is essential reading to learn about integration with Nginx and Apache.
August 26, 2007 at 2:23 am
I can't believe it! I just implemented the -exact same thing- and I was about to release it to the world on Monday. Looks like somebody beat me to it :)?
August 26, 2007 at 2:43 am
After reading a little more about Seesaw, I can say that their approach is more robust than mine, so my last comment was wrong, my solution is not the exact same thing although the results are similar.
August 27, 2007 at 3:23 am
Just wantd to throw out there that Swiftiply, as of the 0.6.1 release, also addresses part of this by providing redeployable requests. If the backend goes down before returning a response, the request can be redeployed to a different backend.
September 7, 2007 at 3:15 pm
@kirk: that sounds like a great idea! Does it detect if Mongrel is down or it will time out after x number of seconds?
September 7, 2007 at 5:59 pm
Here's my hack for those who might be interested:
http://blog.carlmercier.com/2007/09/07/a-better-approach-to-restarting-a-mongrel-cluster/