I am running a project using Mongo DB and Django, I have 2 separate instance for my Django project and database each 16GB ram t2xlarge ubuntu ec2 instances. I am facing issue that within a day or two usage memory on DB server goes above 6GB and on app server it remains below 1GB but freezes application and need to restart machines to recover. Any suggestions and help would be really appreciated.


Mongo will always use all free memory, eventually! That's why you don't put application(s) and mongodb to same server. However, you can use cgroups to restrict resource usage (memory, cpu,...) of mongo.

| improve this answer | |
  • I am using separate machines for mongo and application.. – user3743879 Oct 4 '17 at 10:07
  • So your problem is basically application and not mongo problem. As I wrote, mongo memory usage is normal and expected. Or can you confirm that your mongo freezes and not your application? – JJussi Oct 4 '17 at 14:45
  • Okay I will check db when next time my application goes down..and then get back to you.. thanks for suggestions. – user3743879 Oct 5 '17 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.