Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: library
-
Security Level: Public
-
Environment:OSX 10.8.2
Couchbase: 2.0.0 community edition (build-1976)
Nodejs: v0.8.18 (install via homebrew)
libcouchbase: 2.0.2 (installed via homebrew)
couchbase node module: 0.0.11 (install via npm)
Description
I have been running some tests around performance and ran across a problem attempting to create a large amount of documents. I have broken this down to the simplest example I can think of (see below) and been unable to insert more then 300 documents at a time. I have been able to rewrite the below as a recursive call but this is not ideal. I accept that this might not be a realistic example but do think that this is something which should be able to be done.
var driver = require('couchbase');
var config = {
hosts : [ "localhost:8091" ],
bucket : "default"
};
driver.connect(config, function(err, couchbase) {
console.log("connected");
for(var i=0; i < 300; ++i){
couchbase.set("new_"+i, "something", function(err, meta) {
console.log(err);
console.log("inserted");
});
}
});
var driver = require('couchbase');
var config = {
hosts : [ "localhost:8091" ],
bucket : "default"
};
driver.connect(config, function(err, couchbase) {
console.log("connected");
for(var i=0; i < 300; ++i){
couchbase.set("new_"+i, "something", function(err, meta) {
console.log(err);
console.log("inserted");
});
}
});
http://www.couchbase.com/forums/thread/how-many-simultaneous-sets-can-libcouchbase-handle
http://www.couchbase.com/forums/thread/nodejs-sdk-performance-issue
For me it doesn't work with recursive calls