Navigation Menu

Skip to content

Commit

Permalink
Working on message passing to opmtimize throughput
Browse files Browse the repository at this point in the history
  • Loading branch information
christkv committed Dec 17, 2011
1 parent 0e46a09 commit c72dfb6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
5 changes: 5 additions & 0 deletions HISTORY
Expand Up @@ -3,6 +3,11 @@
- Amortize documents (only deserialize when accessed)
- New C++ serializer code (based on js)
- Mongo tests to handle special Mongos situations
- If a secondary server disappears don't kill the driver connection
- Check for new servers coming online (a new secondary server etc)
- Allow for force send query to primary
- http://api.mongodb.org/python/current/api/pymongo/index.html#pymongo.ReadPreference
- https://github.com/christkv/node-mongodb-native/issues/450

0.9.7.2-2 2011-12-16
* Fixes infinite streamRecords QueryFailure fix when using Mongos (Issue #442)
Expand Down
2 changes: 1 addition & 1 deletion lib/mongodb/responses/mongo_reply.js
Expand Up @@ -49,7 +49,7 @@ MongoReply.prototype.parseBody = function(binary_reply, bson, raw, callback) {
var overflow = 0;

// Just walk down until we get a positive number >= 1
for(var i = 50; i > 0; i--) {
for(var i = 1; i > 0; i--) {
if((this.numberReturned/i) >= 1) {
batchSize = i;
batches = Math.floor(this.numberReturned/i);
Expand Down
11 changes: 6 additions & 5 deletions test/manual_tests/server_load.js
Expand Up @@ -16,11 +16,13 @@ app.configure(function() {

app.renderResponse = function(res, err, data, allCount) {
res.header('Content-Type', 'application/json');

if(err == null) {
if(typeof allCount == "undefined")
if(typeof allCount == "undefined") {
res.send({data: data, success: true});
else
} else {
res.send({allCount: allCount, data: data, success: true});
}
} else {
util.log(util.inspect(err));
console.log(err.stack);
Expand Down Expand Up @@ -142,10 +144,9 @@ app.get('/:db/:collection/:id?', function(req, res, next)
},
spec,
options,
function(err, docs, allCount)
{
function(err, docs, allCount) {
app.renderResponse(res, err, docs, allCount);
});
});

app.listen(9999);
app.listen(9999, '127.0.0.1');

0 comments on commit c72dfb6

Please sign in to comment.