[SERVER-14492] db.currentOp() limited to 5 (five) operations? Created: 07/Jul/14 Updated: 10/Dec/14 Resolved: 07/Jul/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Diagnostics |
| Affects Version/s: | 2.4.10 |
| Fix Version/s: | None |
| Type: | Question | Priority: | Major - P3 |
| Reporter: | Dan Dascalescu | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
Is db.currentOp() limited to 5 operations? I've never seen more than five entries returned in the inprog array. If so, that should be documented. I'm also experiencing what appears to be zombie queries: running db.currentOp() several times (varies from 5 to over 20) in a row outputs 5 query operations with secs_running: 0, after which it outputs an empty inprog. The connection IDs are the same conn55-conn59 but the opids keep changing and the queries are different. It seems as if db.currentOp() displays a history of queries rather. Here's one output:
|
| Comments |
| Comment by Dan Dascalescu [ 07/Jul/14 ] |
|
Thanks Thomas. The issue must be related to the application (Meteor). Indeed, Meteor seems to be opening 5 connections to Mongo at a time. |
| Comment by Thomas Rueckstiess [ 07/Jul/14 ] |
|
Hi Dan, The currentOp() output is not limited to 5 queries, and it shows all operations currently running, not a history. If you want to look at the history of queries, you can Enable Profiling or refer to the log file. This looks to me that you might have 5 connections open to the database, that are all sending operations. You'd see 5 at the same time at each given point in time, the connection ids remain the same but the opids change because they are different operations. "secs_running": 0 indicates that they are fast, and sometimes you might catch a currentOp() where none are running at that exact moment. Think of it as taking a photo of a 5-lane highway (where a lane is a connection), you may see up to 5 cars in one picture, but sometimes less or even 0, depending on traffic. If you have more questions about how currentOp works, please post your question on the mongodb-users group (http://groups.google.com/group/mongodb-user) or Stack Overflow with the mongodb tag. Regards, |