Below is list of results collected with netperf. The interesting value is TCP_CRR, it measures how fast it can TCP connect/request/response/receive. In short, the transaction rate. The test is used to simulate a normal HTTP/1.0 transaction. What's worrying is that this value has very low on Xen virtualized guests. Performance differences between bare metal and virtualization has been as high as 2-3x.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
node.js vs Python with Greenlets (say gevent) | |
I don't get why node.js is being so hyped. | |
Sure, the idea of writing things in JavaScript both on the client and server-side is really nice. | |
And JavaScript really fit an event-driven environment with its browser heritage. | |
But why on earth is boomerang code so appealing to write? I don't get. Am I missing something obvious? | |
All examples of node.js I see are littered with callbacks yet Ryan Dahl thinks coroutines suck. It doesn't add up for me. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CORSMiddleware(object): | |
"""Enable serving of CORS requests (http://en.wikipedia.org/wiki/Cross-origin_resource_sharing)""" | |
ALLOW_ORIGIN = "*" | |
ALLOW_HEADERS = "Origin, X-Requested-With, Content-Type" | |
def __init__(self, app): | |
self.app = app | |
def __call__(self, environ, start_response): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package(default_visibility = ["//visibility:public"]) | |
load("@io_bazel_rules_go//go:def.bzl", "go_prefix", "go_binary") | |
go_prefix("helloworld") | |
go_binary( | |
name = "helloworld", | |
srcs = ["helloworld.go"], | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.InetSocketAddress; | |
import java.util.concurrent.Executors; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.jboss.netty.bootstrap.ServerBootstrap; | |
import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory; | |
import org.jboss.netty.channel.*; | |
import static org.jboss.netty.channel.Channels.pipeline; | |
import org.jboss.netty.handler.codec.http.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var util = require('util'); | |
var exec = require('child_process').exec; | |
function getNpmLinkedPackages (callback) { | |
exec('npm list --global', function (error, stdout, stderr) { | |
if (error) return callback(error); | |
if (stderr.length > 0) return callback(stderr); | |
var pkgs = stdout | |
.split('\n') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hookCanvasGetContext () { | |
var ctxFns = [ | |
'fillRect', | |
'save', | |
'restore', | |
'scale', | |
'rotate', | |
'translate', | |
'transform', | |
'setTransform', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Prints usage for Route 53 for a given time period | |
(exported from the Amazon Route 53 usage console). | |
""" | |
import csv | |
route53_reader = csv.reader(open('route_53_usage_february_2012.csv', 'rb'), delimiter=',', quotechar='|') | |
route53_reader.next() # Skip header | |
zone_lookup = dict('INSERT_ZONE_ID'='mydomain.com') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.jboss.netty.channel.*; | |
import org.jboss.netty.util.HashedWheelTimer; | |
import org.jboss.netty.util.Timeout; | |
import org.jboss.netty.util.Timer; | |
import org.jboss.netty.util.TimerTask; | |
import java.util.concurrent.TimeUnit; | |
/** | |
* Simulates latency of Netty events |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Naive implementation of an activity stream service using Cassandra. | |
# Just a proof of concept and not anything that is for production use. | |
# Probably flawed in many ways like proper key usage, writing and features. | |
import pycassa | |
import datetime | |
import uuid | |
pool = pycassa.connect('Actstream') |
NewerOlder