Search code examples
mongodbconfigurationcpu-usage

mongodb high resource usage and configuration hints


I am running a MongoDB instance as a ubuntu service, on a VM with enough resources to handle it with ease, the system is on-premise and not Cloud. I am a newbie with MongoDB and this is a test/dev environment.

The problem I am getting right now is an abnormal usage of CPU and RAM resources, due to a huge amount of MongoDB threads running and hanging around.

Here's an HTOP resume and a strace of the worse of those bad guys.

sudo strace -p 973
strace: Process 973 attached
futex(0x5644b5e929e8, FUTEX_WAIT_PRIVATE, 0, NULL
strace: Process 973 detached
<detached ...>

other than a possible solution, can you advise me on any interesting articles about setting and configuring Mongo to run for production?

other info:

Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS

> db.version()
4.2.7

Solution

  • Solved.

    apparently one of my collections was growing too big and I was executing various aggregate pipelines on it.

    It ended up clogging the machine, solved with some tweaks to the structure :)