can long query leads to mongod crashes?

30 views
Skip to first unread message

Scarlett Zuo

unread,
Aug 8, 2017, 1:30:14 PM8/8/17
to mongodb-user
Hi all,

I have a three-node replica set on AWS. Production node, Replica and Arbiter. In the past couple of months, there have been 2 incidences of mongod crashing. In both cases, when I look back in the log, there were long queries (sometimes >8000ms) happening right before it crashed. (Apparently, I need better indices.) Both times, it happened on the Production node. The first time, it was primary, and the second time, it was secondary. 

So here are my questions:
1) can long queries lead to mongod crashes?
2) why the second time it's not the mongod on the primary that crashed? It seems that there must be other reason causing this crash - the Production node runs the initial code the queries and write to MongoDB. 

Thanks in advance!
Scarlett

Rhys Campbell

unread,
Aug 9, 2017, 4:15:04 AM8/9/17
to mongodb-user
You'll need to look in your mongod logs and the syslog for your system (/var/log/messages or equivalent).

It's possibly that long queries could use the mongod to use more memory and cause the OS to invoke the OOM (Out-of-memory) Killer. You syslog may confirm this. Better index would probably allieviate this condition.

Scarlett Zuo

unread,
Aug 9, 2017, 3:02:19 PM8/9/17
to mongodb-user
Thanks! In mongod logs, it just stopped. I'll dig in the system log then. 
Reply all
Reply to author
Forward
0 new messages