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

mongos 4.4.8 slow on mongos,but fast on mongod

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL

      i upgrade from 4.4.4 to 4.4.8 cluster.
      cluster has three mongos,three data nodes and one config using replicate with three nodes.
      i recently i find many slow logs on mongos,op_msg more than 1000ms。but data node there is no any more than 100ms.

      i check io,mem,cpu, there is no stress on it. i guess exists problem on mongos.
      but i can't find it.

      mongos slow log:
      {"t":

      {"$date":"2021-10-11T21:15:25.154+08:00"}

      ,"s":"I", "c":"COMMAND", "id":51803, "ctx":"conn3042892","msg":"Slow query","attr":{"type":"command","ns":"wzjMonitor.expWzjMonitor","appName":"wzj_op","command":{"find":"expWzjMonitor","filter":

      {"no":"YT3224052005840"}

      ,"projection":

      {"no":1,"del":1,"curT":1,"oType":1,"matOrg":1,"_id":0}

      ,"$db":"wzjMonitor","$clusterTime":{"clusterTime":{"$timestamp":{"t":1633958124,"i":152}},"signature":{"hash":{"$binary":{"base64":"XbmmyAeBvyjB0IIpxpqKars52yg=","subType":"0"}},"keyId":6958985885933109266}},"lsid":{"id":

      {"$uuid":"5b593b65-b82d-40e8-8c94-682d9e4abc3d"}

      }},"nShards":1,"cursorExhausted":true,"numYields":0,"nreturned":1,"reslen":323,"protocol":"op_msg","durationMillis":1080}}

      but i execute it just 2ms.
      mongos> db.expWzjMonitor.find(

      {"no":"YT3224052005840"}

      ).projection(

      {"no":1,"del":1,"curT":1,"oType":1,"matOrg":1,"_id":0}

      ).explain("executionStats")
      {
      "queryPlanner" : {
      "mongosPlannerVersion" : 1,
      "winningPlan" : {
      "stage" : "SINGLE_SHARD",
      "shards" : [
      {
      "shardName" : "shard2",
      "connectionString" : "shard2/srvdb303.yto.cloud:21002,srvdb305.yto.cloud:21002,srvdb307.yto.cloud:21002",
      "serverInfo" :

      { "host" : "srvdb305.yto.cloud", "port" : 21002, "version" : "4.4.8", "gitVersion" : "83b8bb8b6b325d8d8d3dfd2ad9f744bdad7d6ca0" }

      ,
      "plannerVersion" : 1,
      "namespace" : "wzjMonitor.expWzjMonitor",
      "indexFilterSet" : false,
      "parsedQuery" : {
      "no" :

      { "$eq" : "YT3224052005840" }

      },
      "winningPlan" : {
      "stage" : "PROJECTION_SIMPLE",
      "transformBy" :

      { "no" : 1, "del" : 1, "curT" : 1, "oType" : 1, "matOrg" : 1, "_id" : 0 }

      ,
      "inputStage" : {
      "stage" : "SHARDING_FILTER",
      "inputStage" : {
      "stage" : "FETCH",
      "filter" : {
      "no" :

      { "$eq" : "YT3224052005840" }

      },
      "inputStage" : {
      "stage" : "IXSCAN",
      "keyPattern" :

      { "no" : "hashed" }

      ,
      "indexName" : "no_hashed",
      "isMultiKey" : false,
      "isUnique" : false,
      "isSparse" : false,
      "isPartial" : false,
      "indexVersion" : 2,
      "direction" : "forward",
      "indexBounds" :

      { "no" : [ "[-857763331883698335, -857763331883698335]" ] }

      }
      }
      }
      },
      "rejectedPlans" : [ ]
      }
      ]
      }
      },
      "executionStats" : {
      "nReturned" : 1,
      "executionTimeMillis" : 2,
      "totalKeysExamined" : 1,
      "totalDocsExamined" : 1,
      "executionStages" : {
      "stage" : "SINGLE_SHARD",
      "nReturned" : 1,
      "executionTimeMillis" : 2,
      "totalKeysExamined" : 1,
      "totalDocsExamined" : 1,
      "totalChildMillis" : NumberLong(0),
      "shards" : [
      {
      "shardName" : "shard2",
      "executionSuccess" : true,
      "nReturned" : 1,
      "executionTimeMillis" : 0,
      "totalKeysExamined" : 1,
      "totalDocsExamined" : 1,
      "executionStages" : {
      "stage" : "PROJECTION_SIMPLE",
      "nReturned" : 1,
      "executionTimeMillisEstimate" : 0,
      "works" : 2,
      "advanced" : 1,
      "needTime" : 0,
      "needYield" : 0,
      "saveState" : 0,
      "restoreState" : 0,
      "isEOF" : 1,
      "transformBy" :

      { "no" : 1, "del" : 1, "curT" : 1, "oType" : 1, "matOrg" : 1, "_id" : 0 }

      ,
      "inputStage" : {
      "stage" : "SHARDING_FILTER",
      "nReturned" : 1,
      "executionTimeMillisEstimate" : 0,
      "works" : 2,
      "advanced" : 1,
      "needTime" : 0,
      "needYield" : 0,
      "saveState" : 0,
      "restoreState" : 0,
      "isEOF" : 1,
      "chunkSkips" : 0,
      "inputStage" : {
      "stage" : "FETCH",
      "filter" : {
      "no" :

      { "$eq" : "YT3224052005840" }

      },
      "nReturned" : 1,
      "executionTimeMillisEstimate" : 0,
      "works" : 2,
      "advanced" : 1,
      "needTime" : 0,
      "needYield" : 0,
      "saveState" : 0,
      "restoreState" : 0,
      "isEOF" : 1,
      "docsExamined" : 1,
      "alreadyHasObj" : 0,
      "inputStage" : {
      "stage" : "IXSCAN",
      "nReturned" : 1,
      "executionTimeMillisEstimate" : 0,
      "works" : 2,
      "advanced" : 1,
      "needTime" : 0,
      "needYield" : 0,
      "saveState" : 0,
      "restoreState" : 0,
      "isEOF" : 1,
      "keyPattern" :

      { "no" : "hashed" }

      ,
      "indexName" : "no_hashed",
      "isMultiKey" : false,
      "isUnique" : false,
      "isSparse" : false,
      "isPartial" : false,
      "indexVersion" : 2,
      "direction" : "forward",
      "indexBounds" :

      { "no" : [ "[-857763331883698335, -857763331883698335]" ] }

      ,
      "keysExamined" : 1,
      "seeks" : 1,
      "dupsTested" : 0,
      "dupsDropped" : 0
      }
      }
      }
      }
      }
      ]
      }
      },
      "serverInfo" :

      { "host" : "srvdb303.yto.cloud", "port" : 21051, "version" : "4.4.8", "gitVersion" : "83b8bb8b6b325d8d8d3dfd2ad9f744bdad7d6ca0" }

      ,
      "ok" : 1,
      "operationTime" : Timestamp(1633958637, 1646),
      "$clusterTime" : {
      "clusterTime" : Timestamp(1633958637, 1649),
      "signature" :

      { "hash" : BinData(0,"yhztP+fehpQiXUYJNGyv/zitOrc="), "keyId" : NumberLong("6958985885933109266") }

      }
      }

            Assignee:
            edwin.zhou@mongodb.com Edwin Zhou
            Reporter:
            601290552@qq.com jing xu
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: