I have a long running map/reduce job, it seems to be running incredibly slow
Here are the stats:
{"processtime":97089,"counts":{"input":76907,"emit":76907,"reduce":0,"output":76907},"timing":{"mapTime":2763,"emitLoop":96783,"reduceTime":94137,"mode":"mixed","total":97089}
And sometime I get the following error:
server xxxxxx:10209 sockets closed
Is this normal for a map/reduce job, taking almost 1-2ms per emi.. that seems very heavy?
The job is very simple, any ideas where I can start troubleshooting the issue?
Code..
CampaignContactLastCalled.prototype.$__runContactMapReduce = function( cb) {
var mapReduce = {};
mapReduce.scope = {};
mapReduce.map = function () {
emit({id:this._id, bn:this.bn, hn: this.hn, cn: this.cn, an:this.an}, 1);
};
mapReduce.reduce = function (cid, map) {
return Array.sum(map);
};
mapReduce.query = {};
contactRepository.runMapReduce(mapReduce, function(err, results) {
if(err)
throw err;
else {
cb(null, results);
}
});
};