Martin Šnajdr
Martin Šnajdr

Reputation: 322

Node.js & MongoDB memory consumption

I received an email yesterday from my hosting provider that my Node.js (Express) app and MongoDB (both running with Forever) are consuming too much memory - about 300MB (my hosting limit is 256MB). That node app was just a simple demo generated by express.js and I was the only visitor of my website.

How is that possible? I already upgraded my hosting plan to 512MB, but i am not sure if it's enough for running a node app. I don't expect to have milions of visitors, but how much memory is needed to run a node.js app for like 2000 - 5000 unique visitors a day?

Thank you,
-M

Upvotes: 2

Views: 2690

Answers (1)

Sunday Ironfoot
Sunday Ironfoot

Reputation: 13050

Have a look here http://comments.gmane.org/gmane.comp.lang.javascript.nodejs/36228

This person had a similar issue to you and found a solution. In his case he was using a lot of nested collections in MongoDB which were all getting loaded up, using up a lot of memory.

Another possibility is not deallocating/closing resources after you've finished with them.

Upvotes: 2

Related Questions