How to handle connection issues

12 views
Skip to first unread message

Charlie

unread,
Oct 28, 2013, 1:00:24 PM10/28/13
to mongoo...@googlegroups.com
Hi,

I've got a long running app which is working great most of the time.  However for seemingly no reason requests to the database will start taking much much longer than normal (a simple find() took over 930seconds).  This causes requests to my app to time out.

When this starts happening some requests to the database will go through fine but a lot of them will take too long.  Eventually the app crashes with 'Error: failed to connect to [server.mongohq.com:port]' and after the app restarts everything goes back to normal... until the next time the requests start to time out.

At the moment it seems to be happening once a day or once every 2 days; while this is going on my app becomes unusable.

Does anyone have any suggestions on:

1. Why this might be happening
2. How this can be fixed
3. If it can't be fixed, how to best handle this situation?

I'm using Mongoose 3.6.7 on Node 0.10 on Heroku, with the database being hosted on MongoHQ (EU small)

Many thanks
Reply all
Reply to author
Forward
0 new messages