I got error High CPU

I got error high CPU,

Cat file config as follow:

storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true

  wiredTiger:
    engineConfig:
        cacheSizeGB: 5

systemLog:
  destination: file
  logAppend: true
  #path: /var/log/mongodb/mongod.log
  path: /storage/mongodb/log/mongod.log
  logRotate: reopen

net:
  port: 27017
  #bindIp: 127.0.0.1
  bindIp: 0.0.0.0

processManagement:
  timeZoneInfo: /usr/share/zoneinfo

Looks like there are a lot of python3 processes running on this host and they are taking up all the CPU (mongod process has mere 6.5%) so you may need to look at those rather than your MongoDB set-up.

Asya

2 Likes

The first, thank you for your feedback!
That right, I had a lot of python3 processes in my server.
My script are simple, Initiate connection to, then update a lot of field in collection of db, then close session. I schedule them every 1 hour and I observed CPU increase over time. CPU goes down when I restart mongod service. Looking at the htop result, mongodb are taking up all the CPU.

Did I do something wrong in my script?
Is there a way to limit CPU for mongod service?
Or show me how to test and solve this problem.

Thanks for the help!