[SERVER-9211] CLONE - Mongod 2.4.0 takes upto 99 % cpu and query result is undef Created: 02/Apr/13  Updated: 10/Dec/14  Resolved: 28/Oct/13

Status: Closed
Project: Core Server
Component/s: Diagnostics
Affects Version/s: 2.4.0
Fix Version/s: None

Type: Bug Priority: Critical - P2
Reporter: Arati Sethy Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

linux


Issue Links:
Related
Operating System: Linux
Steps To Reproduce:

1. Run stand alone mongod
2. Create 2 collections with cap of 1GB each
3. have 1.3 and 900k docs in those collections
4. run a query with timestamp range for list of documents with count function

Participants:

 Description   

Hi All,
I upgraded mongodb to 240. I am running standalone mongo server with 2 collections. one having 1.3 million docs other with 900k docs. Running query with a filter to have count of records makes CPU usage to go up till 99%. And query returns no data. I am using perl driver to query. Even after query execution is over, mongod CPU usages remains at 80-90%.
Strace on mongod gave me below out put

Process 3284 attached - interrupt to quit
setuid(4294967295) = 0
setuid(4294967295) = 0
setuid(4294967295) = 0
setuid(4294967295) = 0
setuid(4294967295) = 0
setuid(4294967295) = 0
setuid(4294967295) = 0

My collections are indexed on _id.

Can any one help if i am missing something.
I am using capped collection of 1GB.

Thanks



 Comments   
Comment by Stennie Steneker (Inactive) [ 28/Oct/13 ]

Hi Arati,

I'm closing this issue due to inactivity. As noted on the mongodb-user discussion thread related to this issue, we would need additional information to investigate further.

If you are still seeing this issue (particularly with a newer version of MongoDB 2.4.x) please feel free to open a new issue or comment on this one with the relevant details.

Thanks,
Stephen

Comment by Eliot Horowitz (Inactive) [ 02/Apr/13 ]

The only query I saw was the count, which was a lot faster using count()
If you give another example of a slow query, we can try to help optimize.

Comment by Arati Sethy [ 02/Apr/13 ]

Can you please suggest any alternative? I have tried aggregate too didnt see much difefrence. I run this query every hour.

Comment by Eliot Horowitz (Inactive) [ 02/Apr/13 ]

virtual memory in mongo is going to be 2x data size, and isn't a metric that matters much.

if you have a query that takes 30 seconds, it'll pin 1 core so top will show 99%.

other operations can interleave, causing the cpu to go above 100%, but that one query will peg a core.

Comment by Arati Sethy [ 02/Apr/13 ]

I need to resolve the issue of CPU utilization and Memory usage.
Please read my comments, even if i have a separate query and it takes 30 secs to respond, CPU utilizaton is 99%. virtual mem goes to 20G and actual usage is 13.7%

Generated at Thu Feb 08 03:19:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.