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

12 Oct 2009

Everything is Unix

Jeremy Zawodny takes a look at the * is Unix thing and throws in some additional goodness: more on fork(2), the benefits of copy-on-write, and atomic file operations.

linux-mag.com   11:25

07 Oct 2009

Unix is C

@paulsmith’s simple preforking echo server in C.

gist.github.com   05:20

Perl is Unix

Aristotle Pagaltzis comes through with the simple preforking echo server in Perl.

plasmasturm.org   04:29

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