Created
August 12, 2012 13:18
-
-
Save fengmk2/3331780 to your computer and use it in GitHub Desktop.
Mongodb blackhole
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 mongodb = require('mongodb'); | |
var blackhole = require('net').createServer(function (c) { | |
// console.log('new connection:', c.server._connectionKey); | |
c.end(); | |
}); | |
blackhole.listen(24008, function () { | |
console.log('BlackHole listened at "' + 24008 + '"'); | |
var replSet = new mongodb.ReplSetServers( [ | |
new mongodb.Server('127.0.0.1', 24008, { auto_reconnect: true } ) | |
] | |
); | |
var client = new mongodb.Db('test', replSet); | |
client.open(function (err, p_client) { | |
console.log(err); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
run this script, and look at the
CPU
load.