Skip to content

Instantly share code, notes, and snippets.

View wamatt's full-sized avatar

Matt Tagg wamatt

  • Palo Alto, California
View GitHub Profile

Clustering: The basics

The trick? pass the file descriptor from a parent process and have the server.listen reuse that descriptor. So multiprocess in their own memory space (but with ENV shared usually)

It does not balance, it leaves it to the kernel.

In the last nodejs > 0.8 there is a cluster module (functional although marked experimental)

@wamatt
wamatt / dabblet.css
Created January 17, 2013 07:38
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(35deg, #f06, yellow);
min-height: 18%;
background-repeat: no-repeat;
cursor: url(http://www.google.com/intl/en_ALL/mapfiles/closedhand.cur);
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
$host nodejitsu.com
nodejitsu.com has address 165.225.130.235
nodejitsu.com has address 165.225.131.4
nodejitsu.com has address 165.225.130.240
nodejitsu.com has address 165.225.130.237
nodejitsu.com has address 165.225.131.5
nodejitsu.com has address 165.225.130.241
nodejitsu.com has address 165.225.129.253
nodejitsu.com has address 165.225.130.239
nodejitsu.com has address 165.225.130.238