60% mongod-CPU Usage on IDLE
See original GitHub issueUsing 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:
- Why does this simple query needs so much CPU?
- 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:
- Created 7 years ago
- Comments:9 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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!