Score:0

Mongo DB crash by a peak of the CPU Ubuntu 18

ca flag

Update: As requested I am using 18.04.2-Ubuntu and about the MongoDB enter image description here I have a virtual machine running several Node JS projects and a local instance of Mongo DB. The virtual Machine has only 2 GB of RAM. And I'm monitoring the database with the free monitoring provided by mongo DB

The problem occurs randomly, the CPU usage by Mongo DB goes high, and it overcomes the 2GB Ram and crashes. And the error on the logs (which is attached at the end), points to admin.$cmd what appear in other warnings before without another impact. This issue can not happen for a week, and suddenly happens a day 6am when nobody is calling the server. I suspect some internal MongoDB usage. enter image description here Does anyone have a TIP on why the CPU usage peaks appear or how to avoid them? I could always upgrade the VM or use MongoDB atlas but has no sense that this happens in a VM in which traffic is almost unexisting

{"t":{"$date":"2023-01-11T07:32:53.117+00:00"},"s":"I",  "c":"COMMAND",  "id":23099,   "ctx":"PeriodicTaskRunner","msg":"Task finished","attr":{"taskName":"DBConnectionPool-cleaner","durationMillis":1437}}

{"t":{"$date":"2023-01-11T07:32:35.867+00:00"},"s":"I",  "c":"COMMAND",  "id":51803,   "ctx":"conn29","msg":"Slow query","attr":{"type":"command","ns":"admin.$cmd","command":{"ismaster":1,"$db":"admin"},"numYields":0,"reslen":304,"locks":{},"remote":"127.0.0.1:53792","protocol":"op_msg","durationMillis":43549}}

{"t":{"$date":"2023-01-11T07:31:52.574+00:00"},"s":"I",  "c":"COMMAND",  "id":51803,   "ctx":"LogicalSessionCacheReap","msg":"Slow query","attr":{"type":"command","ns":"config.transactions","command":{"find":"transactions","filter":{"lastWriteDate":{"$lt":{"$date":"2023-01-11T06:58:42.761Z"}}},"projection":{"_id":1},"sort":{"_id":1},"readConcern":{},"$db":"config"},"planSummary":"EOF","keysExamined":0,"docsExamined":0,"cursorExhausted":true,"numYields":0,"nreturned":0,"queryExecutionEngine":"classic","reslen":108,"locks":{"FeatureCompatibilityVersion":{"acquireCount":{"r":3}},"ReplicationStateTransition":{"acquireCount":{"w":1}},"Global":{"acquireCount":{"r":3}},"Mutex":{"acquireCount":{"r":2}}},"readConcern":{"provenance":"implicitDefault"},"storage":{},"protocol":"op_msg","durationMillis":109845}}
guiverc avatar
cn flag
You've not provided any OS/release details; please provide, or are you expecting us to guess? Why ask here, as you've not yet provided anything on-topic given we don't know the OS (https://askubuntu.com/help/on-topic) nor clues as to what package type of mongo db you're using (*snap*? *deb*? etc)
waltinator avatar
it flag
Does your VM have swap space allocated? Read `man free mkswap swapon fstab`
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.