06 Oct 2009

I like Unicorn because it's Unix

Eric Wong’s mostly pure-Ruby HTTP backend, Unicorn, is an inspiration. I’ve studied this file for a couple of days now and it’s undoubtedly one of the best, most densely packed examples of Unix programming in Ruby I’ve come across.

Unicorn is basically Mongrel (including the fast Ragel/C HTTP parser), minus the threads, and with teh Unix turned up to 11. That means processes. And all the tricks and idioms required to use them reliably.

We’re going to get into how Unicorn uses the OS kernel to balance connections between backend processes using a shared socket, fork(2), and accept(2) — the basic Unix prefork model in 100% pure Ruby.

But first …

tomayko.com   09:23

09 Oct 2009

Unicorn!

GitHub documents the how and why behind their Unicorn setup. Also, for the record, the fork(2) + shared accept socket technique described in my Unicorn is Unix piece was first explained to me by Chris and Tom.

github.com   06:54

06 Oct 2009

Python is Unix

Jacob Kaplan-Moss does the prefork echo server example from my Unicorn is Unix piece in Python. Awesome. Let’s see some more of these. Where you at, Perl?

jacobian.org   10:21

04 Oct 2009

Thin vs. Unicorn

Chuck presents the results of a few ab runs against Thin and Unicorn. Surprising, even if the benchmarks lack rigor. I’d like to see good autobench runs for all of the backends on same hardware/network.

cmelbye.github.com   13:27