question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

60% mongod-CPU Usage on IDLE

See original GitHub issue

Using MongoDB 3.2.4 an ElasticSearch 2.3.1 I’m experiencing on IDLE a CPU load of ~60% from a mongod-process. The mongoDB-log is filled every 3 seconds with such an entry: 2016-05-24T01:32:54.296+0200 I COMMAND [conn598] command local.oplog.rs command: count { count: "oplog.rs", query: { ts: { $gte: Timestamp 1462970034000|1 } } } planSummary: COLLSCAN keyUpdates:0 writeConflicts:0 numYields:35407 reslen:62 locks:{ Global: { acquireCount: { r: 70816 } }, Database: { acquireCount: { r: 35408 } }, oplog: { acquireCount: { r: 35408 } } } protocol:op_query 1688ms

So I assume, that this is the mongo-connector, who is polling the oplog(-timestamp) from mongoDB. There are two questions now:

  1. Why does this simple query needs so much CPU?
  2. How to decrease the needed IDLE-ressources? First I’d think of decreasing the polling-rate for example to one minute. But how? I hope I didn’t miss the corresponding config-option on my research.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
behackettcommented, Jun 7, 2016

Actually, in your case we’re just querying on the ts field, which should be fast since we use the oplogReplay option. This requires more research.

0reactions
mumlaxcommented, Jun 14, 2016

I updated my mongo-connector instance successfully. Until now I registered a decrease to an average CPU Usage of 10% by mongod on IDLE. Sometimes peaks up to 40%. Thats a significant improvement, I can confirm the issue-resolution! ✔️ Thanks a lot for the fast fix!

Read more comments on GitHub >

github_iconTop Results From Across the Web

High CPU usage on Mongo server, but Mongo seems to be idle
High CPU usage on Mongo server, but Mongo seems to be idle · It's a sign that you're putting more work than what...
Read more >
[Solved]-MongoDB high cpu usage/long read time-mongodb
That sounds a lot like it could be doing a collection scan rather than using the index. I.e. as your collection grows, the...
Read more >
mongodb - how much does index effect performance (CPU ...
I say so because i drop the index and cpu usage drop to 50% , and back to 200-300% when i recreate it...
Read more >
Primary node of MongoDB ReplicaSet constantly high cpu ...
The cpu of the primary node is between 70-100% even on idle times while the secondaries consumes maximum of 20%. It is important...
Read more >
Monitoring MongoDB Performance Metrics (WiredTiger)
Learn how to monitor MongoDB performance metrics when using the WiredTiger ... If CPU utilization is increasing too much, it can lead to ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found