MongoDB + Nodejs data fetch failing after multiple requests -
i hitting mongodb end point around 30,000 requests per minute. seems work fine till 20,000 requests , after requests failing
t [object object]. (/home/ubuntu/node_modules/mongodb/lib/mongodb/connection/server.js:530:7) @ [object object].emit (events.js:88:20) @ [object object]. (/home/ubuntu/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:104:15) @ [object object].emit (events.js:70:17) @ socket. (/home/ubuntu/node_modules/mongodb/lib/mongodb/connection/connection.js:411:10) @ socket.emit (events.js:67:17) @ array.0 (net.js:319:25) @ eventemitter._tickcallback (node.js:192:41)
closing db connection per iteration, fyi, connecting multiple dbs everytime.
repeating same process 1 time again having same consequences.
this ulimit issue on server because opening many connections, though need @ mongod/mongos logs sure. if case see errors not beingness able allocate resources and/or create new threads. how remedy take here:
http://docs.mongodb.org/manual/administration/ulimit/
also, closing connection, depending on driver using can bad thought , may root cause of problems (especially if have ulimits set appropriately). of drivers these days, including node believe have connection pool manages connections appropriately , allows re-use. closing them explicitly may causing old connections build in short term.
mongodb
No comments:
Post a Comment