node.js - how can I increase the connections for mongoose in nodejs -
i need run 10 queries simultaneously. how do in nodejs application. doing right
var mongoose = require('mongoose'); mongoose.connect('mongodb://localhost:27017/testdb', function(err) { if(err) { console.log(err); } else { console.log('connected database'); } });
what should solve problem. or should change in db configuration.
you can increase poolsize while connecting. try this
var mongoose = require('mongoose'); mongoose.connect('mongodb://localhost:27017/testdb', {server: { poolsize: 50 }}, function(err) { if(err) { console.log(err); } else { console.log('connected database'); } });
Comments
Post a Comment