According to docker container statistics, my mongo database consumes constantly between 250 and 350% cpu. That's pretty impressive since it's a single core system :P
The sad part is that this is my production instance and much more sad is that it has to live until the next prod-backup and thats 3.5 more hours to go.
I tried to do a mongotop but it tells me 0ms stats for all shown collections. Can I do anything else to figure out what's going on?
PS: The db is up for 9 weeks and didn't cause problems.
There is a function called db.currentOp() which lists the currently running queries with very detailed information, it also includes the duration they have been running (secs_running
).
You can then use the currentOp.opid
with db.killOp() to kill that query/operation.
If db.currentOp()
doesn't return any results, because there is no query which went havoc, then there's also db.setProfilingLevel() which will enable profiling by storing queries into the "local" database. Here's a "Tutorial" which is from the "M102: MongoDB for DBAs" Course.
Further information can also be found in this detailed article "Troubleshooting MongoDB 100% CPU load and slow queries" from Igor Khomenko.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With