question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MongoDB server crashes several times a week

See original GitHub issue

Crashes 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:

  1. whydjs (our nodejs app) sometimes takes too much memory (e.g. when running data joints in memory) too quickly, so Mongodb just panics
  2. the system is not configurated adequately for mongodb
  3. mongodb could run entirely from our SSD drive --> no need for RAM?
  4. 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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
coty-crgcommented, Jun 2, 2020

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.

1reaction
adrienjolycommented, Apr 14, 2018

The server has not crashed for 2 weeks! 🎉

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found