node.js - Mongodb or mongoose performance issue -


i developed application backed nodejs/mongodb , frontend in angularjs 1.6.5. application used provide realtime analytics , data being increased in size every single minute new data.

as database size increasing, queries taking longer time execute , sometime fails , giving 404 error. (nginx server) strange thing whenever ran same query in mongo shell in server .explain('executionstats') method giving immediate responses execution time 0 millisecond.

query on mongo shell

execution on browser

execution no limit

so per above screenshots, limit of 10 data mongo shell executing in no time in browser when hitting db through node , mongoose took 1 min couldn't possible return result (maybe nginx returning 404 after specif time)

but try in mongo shell after without setting limit returning data 6331522 records in less 4 seconds.

i have no clue issue exactly. appriciated


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -