[SERVER-7964] Server at 100% CPU, slow queries (15s) in spite of indexes Created: 17/Dec/12 Updated: 17/Dec/12 Resolved: 17/Dec/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 2.0.1, 2.2.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Sebastian Goodman | Assignee: | Unassigned |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Ubuntu 10.10 Server, Dual Core 2.7Ghz Xeon, 8GB RAM |
||
| Operating System: | ALL |
| Participants: |
| Description |
|
Every 2 days, our primary instance hits 100% CPU usage and has to be restarted. By setting the profiling level to 1, I discovered that there are about a dozen EXTREMELY slow count() queries being completed per second: > db.system.profile.find() , "active" : true, "is_image_processed" : true, "hidden_from_feed" : false, "hidden_from_public_feeds" : false }, "fields" : null }, "ntoreturn" : 1, "responseLength" : 48, "millis" : 13930, "client" : "wouldntyouliketoknow" } I've run explain() on a number of these queries. Mongo seems to intelligently choose the index that gives it the fewest number of scanned documents, which is cool. But it means that one explain() does not explain them all. Here's an example: > db.tears.find({ "_id" : { "$gt" : ObjectId("50cdeadeaf58d3de96000294") }, "active" : true, "is_image_processed" : true, "hidden_from_feed" : false, "hidden_from_public_feeds" : false }).explain() , I have not found any queries yet where nscanned is more than a few hundred documents. This particular collection has less than half a million documents. Whether or not these slow queries are related to the server failure, I'd like to speed them up. But my main issue is the server failure. I created a topic with the Google group. We can take the discussion there if you prefer: https://groups.google.com/forum/#!topic/mongodb-user/NbiWPSeYg28 |
| Comments |
| Comment by Ian Whalen (Inactive) [ 17/Dec/12 ] |
|
Hi Sebastian, the Google Groups forums are definitely the best place to begin this conversation - I'm going to close this for now and allow someone from our team to follow up at the link you provided. If it turns out you've identified a bug then please do reopen this ticket. |