Unicorn has implemented some UNIX old-school techniques with some clever wiring and delivered a solid Rails / Rack server that provides zero-downtime-app-restart, OS-level load balancing between workers and restarts a worker when it’s hanging or dies. I needed something similar to this for node.js, and after some searching I found Spark and Multi-node. Spark was the one that caught my eye with the simple design. It allowed for load balancing between worker processes, but not the other Unicorn-like features I was looking for (like worker ressuscitation and zero-downtime-app-restart), so I dug in. And Fugue was my shot at this problem. Just like Spark, Fugue works with any node.js server that descends from net.Server, like http.Server, connect.Server, etc. Besides TCP, Fugue also supports unix sockets (which may come very handy if you want to configure a fast in-the-same-box upstream server for your front-end Nginx). Here is an example of how you can start fugue on your app:

var fugue = require('fugue'),
    http =   require('http');

var server = http.createServer(function (request, response) {
  response.writeHead(200, {'Content-Type': 'text/plain'});
  response.end('Hello World\n');
});

// instead of server.listen, call fugue.start with your server like this:
fugue.start(server, 4000, null, 2, {master_pid_path : '/tmp/my_server.pid'});

You can save this in my_server.js and you can start your app:

$ node my_server.js

And then you can restart your app by issuing:

$ kill -USR2 `cat /tmp/my_server.pid`