Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-14492

db.currentOp() limited to 5 (five) operations?

    • Type: Icon: Question Question
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.4.10
    • Component/s: Diagnostics
    • None

      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:

      mongod-2.4.10| stockbase-prod> db.currentOp()
      {
        "inprog": [
          {
            "active": true,
            "client": "127.0.0.1:51757",
            "connectionId": 55,
            "desc": "conn55",
            "lockStats": {
              "timeAcquiringMicros": {
                "r": NumberLong("167661"),
                "w": NumberLong("0")
              },
              "timeLockedMicros": {
                "r": NumberLong("185231"),
                "w": NumberLong("0")
              }
            },
            "ns": "stockbase-prod.companies",
            "numYields": 17,
            "op": "query",
            "opid": 4637790,
            "query": {
              "$query": {
                "symbol": {
                  "$options": "i",
                  "$regex": "^.+itpc"
                }
              },
              "orderby": {
                "symbol": 1
              }
            },
            "secs_running": 0,
            "threadId": "0x7f9fa8ee9700",
            "waitingForLock": false
          },
          {
            "active": true,
            "client": "127.0.0.1:51760",
            "connectionId": 58,
            "desc": "conn58",
            "lockStats": {
              "timeAcquiringMicros": {
                "r": NumberLong("115074"),
                "w": NumberLong("0")
              },
              "timeLockedMicros": {
                "r": NumberLong("169989"),
                "w": NumberLong("0")
              }
            },
            "ns": "stockbase-prod.companies",
            "numYields": 17,
            "op": "query",
            "opid": 4637792,
            "query": {
              "$query": {
                "symbol": {
                  "$options": "i",
                  "$regex": "^.+bfcf"
                }
              },
              "orderby": {
                "symbol": 1
              }
            },
            "secs_running": 0,
            "threadId": "0x7f9fa91ec700",
            "waitingForLock": false
          },
          {
            "active": true,
            "client": "127.0.0.1:51761",
            "connectionId": 59,
            "desc": "conn59",
            "lockStats": {
              "timeAcquiringMicros": {
                "r": NumberLong("143480"),
                "w": NumberLong("0")
              },
              "timeLockedMicros": {
                "r": NumberLong("189736"),
                "w": NumberLong("0")
              }
            },
            "ns": "stockbase-prod.companies",
            "numYields": 16,
            "op": "query",
            "opid": 4637791,
            "query": {
              "$query": {
                "symbol": {
                  "$options": "i",
                  "$regex": "^.+sfl"
                }
              },
              "orderby": {
                "symbol": 1
              }
            },
            "secs_running": 0,
            "threadId": "0x7f9fa92ed700",
            "waitingForLock": false
          },
          {
            "active": true,
            "client": "127.0.0.1:51759",
            "connectionId": 57,
            "desc": "conn57",
            "lockStats": {
              "timeAcquiringMicros": {
                "r": NumberLong("47742"),
                "w": NumberLong("0")
              },
              "timeLockedMicros": {
                "r": NumberLong("81799"),
                "w": NumberLong("0")
              }
            },
            "locks": {
              "^": "r",
              "^stockbase-prod": "R"
            },
            "ns": "stockbase-prod.companies",
            "numYields": 1,
            "op": "query",
            "opid": 4637793,
            "query": {
              "$query": {
                "symbol": {
                  "$options": "i",
                  "$regex": "^.+lvnta"
                }
              },
              "orderby": {
                "symbol": 1
              }
            },
            "secs_running": 0,
            "threadId": "0x7f9fa90eb700",
            "waitingForLock": false
          },
          {
            "active": true,
            "client": "127.0.0.1:51758",
            "connectionId": 56,
            "desc": "conn56",
            "lockStats": {
              "timeAcquiringMicros": {
                "r": NumberLong("44177"),
                "w": NumberLong("0")
              },
              "timeLockedMicros": {
                "r": NumberLong("74988"),
                "w": NumberLong("0")
              }
            },
            "locks": {
              "^": "r",
              "^stockbase-prod": "R"
            },
            "ns": "stockbase-prod.companies",
            "numYields": 1,
            "op": "query",
            "opid": 4637794,
            "query": {
              "$query": {
                "symbol": {
                  "$options": "i",
                  "$regex": "^lvnta"
                }
              },
              "orderby": {
                "symbol": 1
              }
            },
            "secs_running": 0,
            "threadId": "0x7f9fa8fea700",
            "waitingForLock": false
          }
        ]
      }
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            dandv Dan Dascalescu
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: