While query time and collector time bigger than request took time when profiling?

the search is very simple

{
  "profile": true,
  "size": 0,
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "appid": "300047"
          }
        }
      ]
    }
  }
}

and the response is

"took" : 5,
  "timed_out" : false,
  "_shards" : {
    "total" : 64,
    "successful" : 64,
    "failed" : 0
  },
  "hits" : {
    "total" : 765081197,
    "max_score" : 0.0,
    "hits" : [ ]
  },
  "profile" : {
    "shards" : [
      {
        "id" : "[pC6DBL4IQ6Ka3Rj-bAoA][xxx-20190118][15]",
        "searches" : [
          {
            "query" : [
              {
                "type" : "",
                "description" : "appid:[300047 TO 300047]",
                "time" : "324.4299370ms",
                "breakdown" : {
                  "score" : 0,
                  "build_scorer_count" : 1,
                  "match_count" : 0,
                  "create_weight" : 10594,
                  "next_doc" : 312452287,
                  "match" : 0,
                  "create_weight_count" : 1,
                  "next_doc_count" : 11949424,
                  "score_count" : 0,
                  "build_scorer" : 17630,
                  "advance" : 0,
                  "advance_count" : 0
                }
              }
            ],
            "rewrite_time" : 40843,
            "collector" : [
              {
                "name" : "CancellableCollector",
                "reason" : "search_cancelled",
                "time" : "870.9503310ms",
                "children" : [
                  {
                    "name" : "TotalHitCountCollector",
                    "reason" : "search_count",
                    "time" : "293.1619620ms"
                  }
                ]

so the request took 5ms, but query time spent 324.4ms and collector spent 878ms?

Please don't post images of text as they are hardly readable and not searchable.

Instead paste the text and format it with </> icon. Check the preview window.

Changed

I think this is the same thing as my question here: https://github.com/elastic/elasticsearch/issues/33489.

ES profiling uses sampling so the profile timings can be compared relative to each other but do not compare with the actual wall time in took.

got it , thank u.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.