Node JS [Mean Stack] on linux instance behaving inconsistently. Json data not being sent. MongoError: cursor killed or timed out error appears often

12 views
Skip to first unread message

Vasumathy Seenuvasan

unread,
Apr 20, 2017, 3:17:38 PM4/20/17
to nodejs
I have a Node JS application [MEAN stack - Node version: `v0.10.40`, Mongoose: `3.8.8`, Express: `4.0.0`.] running on a linux instance. It was working fine but during the past few days the app is responding really slow. 

  1. For mongo queries, the below error is thrown `MongoError: cursor killed or timed out`.
  2.  And for few queries even though the data is returned by the database, it is not being sent back to Angular from the controller. It is failing at `return res.json()` statement . 
If I restart the app it seems to work most of the times but again after few hours the same issues reappear.  

Command to start the app and stack allocation:

NODE_ENV=production forever start -a -l forever.log -o output.log -e error.log -c "node --stack_size=12288 --max-old-space-size=12288" server/app.js


The same app is working from my local machine which has the same node, express, mongoose version. Could you guys help with this.



Reply all
Reply to author
Forward
0 new messages