3

I am facing this issue consistently, whenever I run some CPU and memory intensive processes so OS kills my mongod service. Due to which service goes into the failed state and everything stops.

Command:

journalctl -u mongod.service

Output:

Jun 01 04:41:18 leadsearch systemd[1]: mongod.service: Main process exited, code=killed, status=6/ABRT
Jun 01 04:41:18 leadsearch systemd[1]: mongod.service: Failed with result 'signal'.

Is there any way to check details why my mongod service is being killed by OS?

Please suggested if there is anyway to fix this issue, or am I doing something wrong?

Abdul Moiz
  • 133
  • 6
  • It sounds like your system is running out of RAM. Have you checked how much RAM you have available when this happens? – terdon Jun 01 '20 at 15:32
  • This is a long running job, how can i monitor RAM all the time? – Abdul Moiz Jun 01 '20 at 16:19
  • 1
    Well, you can just keep an eye on it and see if it rises just before the service is killed. Alternatively, you can run `while :; do date; free; sleep 10s; done > ramlog` which will run `free` every 10 seconds. That should give you an idea of what is happening. Just leave that running and, next time the service dies, kill the while loop and check the `ramlog` file. That should help. But you already said this happens when you run memory-intensive processes, so it really sounds typical of the [OOM killer](https://docs.memset.com/other/linux-s-oom-process-killer). – terdon Jun 01 '20 at 16:26
  • What does the `mongod` log say? – D. SM Jun 02 '20 at 01:56
  • I think i got it: mongod logs: failed to write 8192 bytes at offset 11183755264: No space left on device – Abdul Moiz Jun 02 '20 at 14:13
  • @terdon That really had helpful, can we log CPU and disk usage as well along with RAM? – Abdul Moiz Jun 02 '20 at 14:16
  • 1
    @AbdulMoiz yes, but that should be a separate question so you can explain exactly what you need. There are various tools designed for this anyway, it would be better to ask a new question. – terdon Jun 02 '20 at 14:17

0 Answers0