I recently started using OpenShift as a scalable platform for a NodeJS + MongoDB application. I got it all working, except that after some time (mostly within a few hours or days) my application suddenly gets inaccesible. I think there are 2 causes for my app to stop. One cause is that the MongoDB connection times out, which is probably an easy fixable error by checking whether the database is still connected before using the database.
However the other cause is that NodeJS suddenly stops listening to new requests. I am not exactly sure what happens and what the reason for this behaviour is, but when this happens, I have to manually restart the application through ssh, and in a production environment this is unacceptable.
Since I dont get any errors, I can't really provide any more details, except that i (probably) have a scalable app, currently using 2 gears, one for the NodeJS app and one for the MongoDB database. I use MongooseJS to connect to the database. For the time being im still in the free plan, but once more traffic is coming, ill probably go for the silver plan (assuming that scaling actually works).
I hope someone can provide me with some advice or a solution.
Sincerely,
Hylke Bron