I have an app on Heroku and Mongolab. I use node.js and mongoose. Heroku often logs that my memory consumption is over their limit and part of it is swapped to hard-drive. From time to time I have disconnected from my Mongolab database, so my entire app is down for about 5 minutes. At the beginning I have couple of Heroku timeouts. After that, Heroku restart my app and I have Error: failed to connect to [ds057900.mongolab.com:57900] multiple times. After couple of restarts it backs up. Mongolab team tells me that on their side is everything ok. Heroku team tells me that it may be memory issue. One full restart isn't enough to up my app back. May it be a problem with memory leaks in my app?
Asked
Active
Viewed 776 times
4
-
Did you solved your problem? IF you're using mongoose see [this](http://mongoosejs.com/docs/connections.html#keepAlive) – eAbi Dec 01 '13 at 14:21
-
1After weird behaviors with Mongoose that I had I switched Heroku to EC2, Node.js to Go and started utilizing my secondary Mongo instance. Go with Mgo library seems to be more stable. So many things changed but one interesting thing that I discovered after the switch was that usage of $regex on non-indexed field is a suicide for your app. Never do that. MongoDB seems to queue all of that queries and process them even if your connection is already dead. So simple restart of server is not enough. – Rafał Sobota Dec 01 '13 at 18:12
-
And there's no solution for clearing the queue? That would really be a suicide for an app in much many situations. I don't think this is quite optimal. I know that you can benchmark and do the "big mistakes" on a DEV MongoDB instance but those can still propagate through your production app. Maybe restarting your db in a safe way by processing the write-only tasks. Or another way... – eAbi Dec 01 '13 at 20:24
-
Chris from MongoLab here. As always, any of our users can reach out to support@mongolab.com if they need help! – Chris Chang Nov 10 '14 at 18:17
1 Answers
0
Seems like you are using Heroku's add on for mongo DB, give a try to any database of you own rented by Mongolab or MongoHQ.

Taha
- 135
- 7