ElasticSearch 配置文件 API `time_in_nanoseconds` 值高于 `took` 时间

ElasticSearch profile API `time_in_nanoseconds` value higher than `took` time

我正在使用 ElasticSearch 配置文件 API 来帮助处理缓慢的查询。

当我阅读 the elasticsearch profiling docs 时,听起来碎片中查询的 time_in_nanos 值应该小于 运行 分析查询的总 took 时间。

但是,我得到了以下结果:

{
  "took": 109695,
   ...
  "profile": {
    "shards": [
       {
         "searches": [
           {
             "query": [
               {
                 "type": "BooleanQuery",
                 "time": "1550750.786ms",
                 "time_in_nanos": 1550750786163
                 ...
               }
             ]
           }
         ]
       }
       ...
     ]
  }
}

所以,我看到查询 took 109695 ms ~= 109 seconds 这似乎是正确的。

但是,我看到 time_in_nanos1550750786163 值对应超过 20 分钟。这与 took 值不匹配。 curl 命令用了大约 2 分钟,因此 took 时间似乎准确,而 time_in_nanos 时间似乎不准确。

解释 ElasticSearch 配置文件查询中 time_in_nanos 值的正确方法是什么?

ES 版本:5.6

根据 Elastic search Github 存储库,配置文件时间是采样的结果。因为它们是抽样的,原始计时数字对于大型查询可能不准确。

但是,这些数字可用于将部分查询与查询的其他部分进行比较,以确定各个部分的相对费用。

来源:https://github.com/elastic/elasticsearch/issues/33489