Skip to content

Instantly share code, notes, and snippets.

View blakmatrix's full-sized avatar
🧿
You may be gone tomorrow, but that doesn't mean that you weren't here today.

❤️ Farrin Reid blakmatrix

🧿
You may be gone tomorrow, but that doesn't mean that you weren't here today.
View GitHub Profile

Overview

We run multiple server processes in two data centers. Each process listens on two ports, one for HTTP and one for HTTPS. HTTPS is terminated by Apache prior to reaching node.js. HTTP goes directly from the client to node.js (through a master load balancer). We do not use clusters. We slice our physical servers into thin virtual machines running SmartOS, each with about 3GB of memory designed for a single node.js process.

Our node.js servers are hapi.js servers using the composer functionality and plugins architecture. We have three sets of plugins loaded: mobile web front end experience (single page app), legacy API reverse proxy, and monitoring.

We also serve original node.js services off another server zone which runs closed source plugins using hapi.

Analytics

**/
const int c = 261;
const int d = 294;
const int e = 329;
const int f = 349;
const int g = 391;
const int gS = 415;
const int a = 440;
const int aS = 455;
var http = require('http');
var buf0 = new Buffer([0]);
var server = http.createServer(function (req, res) {
res.setHeader('content-type', 'multipart/octet-stream');
res.write('Welcome to the Fun House\r\n');
res.write('> ');
req.on('data', function (buf) {
res.write(buf);
var redis = require('redis');
var client = redis.createClient(6479, 'nodejitsudb625902.redis.irstack.com');
client.auth('nodejitsudb625902.redis.irstack.com:f327cfe980c9b8e975fbebb4', function (err) {
if (err) { throw err; }
// You are now connected to your redis.
});
//client An existing redis client object you normally get from redis.createClient()
app.js
======
var routes = require('./routes')
, app = express()
, server = http.createServer(app)
, io = socketio.listen(server);
app.get('/events/:shortname', routes.event);
@blakmatrix
blakmatrix / gist:3758429
Created September 20, 2012 21:21
Nodejitsu package.json
{
"name": "distilledchaos",
"subdomain": "distilledchaos",
"domains": [
"distilledchaos.net",
"www.distilledchaos.net"
],
"version": "0.3.2-6",
"private": true,
"scripts": {
@blakmatrix
blakmatrix / gist:3519240
Created August 29, 2012 21:31 — forked from devandy/gist:3487797
package.json
{
"name": "pol",
"version": "0.0.1-24",
"private": true,
"scripts": {
"start": "app.coffee"
},
"dependencies": {
"ejs": "0.8.0",
"express": "3.0.0rc1",
@blakmatrix
blakmatrix / gist:3519238
Created August 29, 2012 21:31 — forked from devandy/gist:3487797
package.json
{
"name": "pol",
"version": "0.0.1-24",
"private": true,
"scripts": {
"start": "app.coffee"
},
"dependencies": {
"ejs": "0.8.0",
"express": "3.0.0rc1",
{
"name": "node",
"subdomain": "nclud",
"scripts": {
"start": "server.js"
},
"version": "0.1.0-70",
"engines": {
"node": "0.8.x"
},
@blakmatrix
blakmatrix / gist:3418257
Created August 21, 2012 18:44 — forked from mquan/gist:3418248
turbobin package.json
{
"name": "turbobin",
"description": "supercharge your point of sale",
"author": "Quan Nguyen",
"version": "0.8.6-12",
"dependencies": {
"express": "2.5.11",
"coffee-script": "1.3.3",
"socket.io": "0.9.10",
"underscore": "1.3.3",