MongoDB server crashes several times a week
See original GitHub issueCrashes were much more frequent when mongodb+nodejs were running on a 2gb-ram instance, than now on a 3gb-ram instance. But still, I need to manually run sudo service mongodb restart
several times a week, whenever openwhyd users see a “502 Bad Gateway” page while trying to access openwhyd.org. (e.g. https://www.facebook.com/groups/openwhyd/permalink/2056648404616708/)
Hypothesis:
- whydjs (our nodejs app) sometimes takes too much memory (e.g. when running data joints in memory) too quickly, so Mongodb just panics
- the system is not configurated adequately for mongodb
- mongodb could run entirely from our SSD drive --> no need for RAM?
- could upgrading to the latest version of mongodb solve this issue?
Next steps:
- download and read
/var/log/mongodb/mongod.log
- apply mongodb’s “warning” recommendations (Disable Transparent Huge Pages (THP)) then reboot droplet
- find solutions on how to reduce mongodb memory usage (to try if it crashes again)
- wait 1 week to check if applying mongodb’s recommendations prevented crashes, or try other solutions
- if above solutions don’t fix the issue, check out mongodb’s changelog and consider upgrading
- update openwhyd’s server maintainance cookbook, to reflect changes
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:12 (10 by maintainers)
Top Results From Across the Web
MongoDB servers are crashing - Installation & Upgrades
We have Mongo DB replicaset configured and have the sharding implemented as well. The system has been running for more than 2 years...
Read more >MongoDB Primary keeps on crashing after about 2 weeks
The problem is, since then the primary will crash about every two weeks. We have these servers in Grafana with custom monitoring, and...
Read more >Primary node keeps crashing - second time in one week
Server crashes updating an index and can't restart. I tried to restart the server manually (see restart.log) but not sure how to proceed....
Read more >MongoDB crashed under stress - Stack Overflow
First 6 hours everything is normal. But later mongodb connections are increasing abnormally to 3,500 connections. And the current queue is 1500.
Read more >MongoDB crashing on server (debian/linux/ubuntu) - Medium
A few weeks ago our MongoDB database hosted on Debian 9 server started to get unexpected crashes. Our first action towards this problem...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just letting you know, you’re not alone. I have my scripts just auto-restart mongo at this point; it randomly crashes after running for long periods of time! I can only assume it’s due to the small amount of memory available to it, but that’s not an acceptable reason.
The server has not crashed for 2 weeks! 🎉