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

Why me execute the same command but get different result?

    XMLWordPrintable

    Details

    • Type: Question
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Incomplete
    • Affects Version/s: 2.4.10
    • Fix Version/s: None
    • Component/s: Indexing, Querying
    • Labels:
      None

      Description

      I used mongodb 2.4.10 to collect some app logs, sometimes when i statistics and analysis, i execute a same command, but give me different result:

          logReplSet:PRIMARY> db.ofapi_inf_record_20140825.count({"invokeTime":{"$gte":"2014-08-29 19:30:52","$lte":"2014-08-29 19:41:52"},"exceptionMsg":{"$ne":null}})
          86
          logReplSet:PRIMARY> db.ofapi_inf_record_20140825.count({"invokeTime":{"$gte":"2014-08-29 19:30:52","$lte":"2014-08-29 19:41:52"},"exceptionMsg":{"$ne":null}})
          47
          logReplSet:PRIMARY> db.ofapi_inf_record_20140825.count({"invokeTime":{"$gte":"2014-08-29 19:30:52","$lte":"2014-08-29 19:41:52"},"exceptionMsg":{"$ne":null}})
          47
          logReplSet:PRIMARY> db.ofapi_inf_record_20140825.count({"invokeTime":{"$gte":"2014-08-29 19:30:52","$lte":"2014-08-29 19:41:52"},"exceptionMsg":{"$ne":null}})
          47
          logReplSet:PRIMARY> db.ofapi_inf_record_20140825.count({"invokeTime":{"$gte":"2014-08-29 19:30:52","$lte":"2014-08-29 19:41:52"},"exceptionMsg":{"$ne":null}})
          47

      the current db and collection status:

          logReplSet:PRIMARY> db.stats()
          {
          "db" : "logs",
          "collections" : 45,
          "objects" : 2108341434,
          "avgObjSize" : 747.0257969857837,
          "dataSize" : NumberLong("1574985440052"),
          "storageSize" : NumberLong("1634846926048"),
          "numExtents" : 1303,
          "indexes" : 230,
          "indexSize" : 661429905136,
          "fileSize" : NumberLong("2365305389056"),
          "nsSizeMB" : 16,
          "dataFileVersion" : {
              "major" : 4,
              "minor" : 5
          },
          "ok" : 1
          }
       
          logReplSet:PRIMARY> db.ofapi_inf_record_20140825.stats()
          {
          "ns" : "logs.ofapi_inf_record_20140825",
          "count" : 45681275,
          "size" : 45292806320,
          "avgObjSize" : 991.496106884057,
          "storageSize" : 47941103312,
          "numExtents" : 43,
          "nindexes" : 6,
          "lastExtentSize" : 2146426864,
          "paddingFactor" : 1,
          "systemFlags" : 1,
          "userFlags" : 0,
          "totalIndexSize" : 18175558688,
          "indexSizes" : {
              "_id_" : 1482316976,
              "invokeTime_-1.0_methodName_1.0" : 7287988288,
              "uuId_1.0" : 3596499760,
              "paramValues.userCode_1.0" : 1950908064,
              "costTime_-1.0" : 2296245952,
              "exceptionMsg_1.0" : 1561599648
          },
          "ok" : 1
          }
       

      Mongodb Logs: (first cost 51952ms )

      Mon Sep  1 08:59:27.659 [conn5901521] command logs.$cmd command: { count: "ofapi_inf_record_20140825", query: { invokeTime: { $gte: "2014-08-29 19:30:52", $lte: "2014-08-29 19:41:52" }, exceptionMsg: { $ne: null } }, fields: {} } ntoreturn:1 keyUpdates:0 numYields: 1494 locks(micros) r:101254026 reslen:48 51952ms
      Mon Sep  1 08:59:55.252 [conn5901521] command logs.$cmd command: { count: "ofapi_inf_record_20140825", query: { invokeTime: { $gte: "2014-08-29 19:30:52", $lte: "2014-08-29 19:41:52" }, exceptionMsg: { $ne: null } }, fields: {} } ntoreturn:1 keyUpdates:0 numYields: 1 locks(micros) r:317472 reslen:48 169ms
      Mon Sep  1 09:03:27.404 [conn5901521] command logs.$cmd command: { count: "ofapi_inf_record_20140825", query: { invokeTime: { $gte: "2014-08-29 19:30:52", $lte: "2014-08-29 19:41:52" }, exceptionMsg: { $ne: null } }, fields: {} } ntoreturn:1 keyUpdates:0 numYields: 2 locks(micros) r:292434 reslen:48 169ms
      Mon Sep  1 09:03:29.201 [conn5901521] command logs.$cmd command: { count: "ofapi_inf_record_20140825", query: { invokeTime: { $gte: "2014-08-29 19:30:52", $lte: "2014-08-29 19:41:52" }, exceptionMsg: { $ne: null } }, fields: {} } ntoreturn:1 keyUpdates:0 locks(micros) r:162235 reslen:48 162ms
      Mon Sep  1 09:22:09.624 [conn5901521] command logs.$cmd command: { count: "ofapi_inf_record_20140825", query: { invokeTime: { $gte: "2014-08-29 19:30:52", $lte: "2014-08-29 19:41:52" }, exceptionMsg: { $ne: null } }, fields: {} } ntoreturn:1 keyUpdates:0 numYields: 281 locks(micros) r:373800 reslen:48 380ms

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: