Permalink
Browse files

pool changes, too many connections is crashing systems atm

  • Loading branch information...
dstrek
dstrek committed Feb 15, 2013
1 parent 8e35981 commit db95a71ad2ffc23352c4996a9aa3065ff287809d
Showing with 11 additions and 6 deletions.
  1. +3 −0 readme.md
  2. +8 −6 test/performance/db_smasher_pool.js
View
@@ -11,3 +11,6 @@ Using this could be perilous ;p
This relies on https://github.com/chrisdew/protobuf which should build fine in all your standard envs with node 0.8
+
+
+Make sure protobuf compiles when the
@@ -7,7 +7,7 @@ var logerror = require('debug')('rdb:error');
var connectionPool = pool.Pool({
name: 'rethinkdb',
max : 100,
- min : 90,
+ min : 2,
log : true,
idleTimeoutMillis : 1 * 60 * 1000,
reapIntervalMillis: 30 * 1000,
@@ -20,7 +20,7 @@ var connectionPool = pool.Pool({
return callback(null, connection);
},
function() {
- var errMsg = util.format("Failed connecting to RethinkDB instance on {host: %s, port: %s}", dbConfig['host'] || localhost, dbConfig['port'] || 28015);
+ var errMsg = "Failed connecting to RethinkDB instance";
return callback(new Error(errMsg));
}
);
@@ -46,14 +46,16 @@ function connect(callback) {
function result(c) {
return function(r) {
- console.log('inserted?', r);
- connectionPool.release(c);
+ //console.log('inserted?', r);
+ //connectionPool.release(c);
}
}
-for (var x=0; x<20000; x++) {
+for (var x=0; x<90; x++) {
connect(function(err, con) {
if (err) throw err;
- con.run(r.db('test').table('test').insert({val: 1}), result(con));
+ for (var y=0; y<10000; y++) {
+ con.run(r.db('test').table('test').insert({val: 1}), result(con));
+ }
});
}

0 comments on commit db95a71

Please sign in to comment.