Skip to content

Instantly share code, notes, and snippets.

// Map/Reduce with Promises on Narwhal+Node
var SYSTEM = require("system");
var EL = require("event-loop");
var Q = require("narwhal/promise");
var UTIL = require("narwhal/util");
// to simulate a long latency, promise-returning API
var delay = function (timeout) {
var deferred = Q.Deferred();

Tests to do:

Create an environment with 4 (at least >2) servers each running a single process with 40 writing threads. Each writing thread should insert a new document at some prescribed rate (maybe make the threads and the document insertion a configuration parameter?)

Have each of these servers writing to one or more of the nosql "servers" (depending on architecture) -- maybe run one test where all the writes are going to one server, and another where they are spread.

Then lets see how long it takes for each of the servers in a cluster to "catch up" (e.g. what is the lag time average and std dev -- if thats even possible to compute) before a new document is replicated around.

Once we have a feel for this, lets repeat the test but pull one server out of the replication environment. We should do this test twice, once where we remove the server gracefully and once violently. In both cases we'll leave the server "offline" for several tens-of-minutes or hours. Then lets compute the number of documents th

APACHE:
$ ab -k -c 50 -n 20000 http://127.0.0.1/statread.js 2>&1 | grep "Requests per second"
Requests per second: 12370.69 [#/sec] (mean)
NGINX:
$ ab -k -c 50 -n 20000 http://127.0.0.1/statread.js 2>&1 | grep "Requests per second"
Requests per second: 20262.73 [#/sec] (mean)
NODE:
$ ab -k -c 50 -n 20000 http://127.0.0.1:8000/statread.js 2>&1 | grep "Requests per second"
import scala.collection.mutable._
// I want these std functions to be implicit:
implicit def tupled[a1, a2, b] = Function.tupled[a1, a2, b](_)
implicit def untupled[a1, a2, b] = Function.untupled[a1, a2, b](_)
class Connection
class ConnectionPool(size: Int) {
def withConnection[A](f: Connection => A) = f(new Connection)
alert('oh hai.');
@zaach
zaach / Gemfile
Created February 19, 2010 05:27 — forked from indirect/Gemfile
# include at least one source and the rails gem
source :gemcutter
gem "rails", "~> 2.3.5", :require => nil
gem "sqlite3-ruby", :require => "sqlite3"
group :development do
# bundler requires these gems in development
gem 'rails-footnotes'
end
java.lang.NullPointerException: null (NativeException)
com/rdm/neocast/server/logic/GenerateDownloadMediaLogic.java:137:in `<init>'
com/rdm/neocast/server/logic/GenerateDownloadMediaLogic.java:175:in `<init>'
sun/reflect/NativeConstructorAccessorImpl.java:-2:in `newInstance0'
sun/reflect/NativeConstructorAccessorImpl.java:39:in `newInstance'
sun/reflect/DelegatingConstructorAccessorImpl.java:27:in `newInstance'
java/lang/reflect/Constructor.java:513:in `newInstance'
org/jruby/javasupport/JavaConstructor.java:226:in `new_instance'
org/jruby/java/invokers/ConstructorInvoker.java:114:in `call'
org/jruby/java/invokers/ConstructorInvoker.java:201:in `call'
java.io.FileNotFoundException: /NEOCAST/etc/NettyModule.cfg (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileReader.<init>(FileReader.java:55)
at org.rdm.util.propertylist.PropertyList.createFrom(PropertyList.java:131)
at com.rdm.neocast.server.model.database.MediaPlayer.findFromCommandLineArguments(MediaPlayer.java:506)
at com.rdm.neocast.server.model.database.MediaPlayer.findFromCommandLineArguments(MediaPlayer.java:629)
at com.rdm.neocast.server.model.database.MediaPlayer.findFromCommandLineArguments(MediaPlayer.java:644)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
@zaach
zaach / workflow.md
Created January 26, 2010 21:10 — forked from gstark/workflow.md

Semantic Versioning

Details:

Versions are denoted using a standard triplet of integers: MAJOR.MINOR.PATCH. The basic intent is that MAJOR versions are incompatible, large-scale upgrades of the API. MINOR versions retain source and binary compatibility with older minor versions, and changes in the PATCH level are perfectly compatible, forwards and backwards.

Semantic Versioning

Details: http://semver.org/, http://apr.apache.org/versioning.html

Versions are denoted using a standard triplet of integers: MAJOR.MINOR.PATCH. The basic intent is that MAJOR versions are incompatible, large-scale upgrades of the API. MINOR versions retain source and binary compatibility with older minor versions, and changes in the PATCH level are perfectly compatible, forwards and backwards.

Patch level changes could also be for correcting incorrect APIs. In this case, the previous patch release may be incompatible, but because of bugs.

Minor versions may introduce new features, but do not alter any of the previous API.