Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Performance 弹性搜索:聚合查询非常慢_Performance_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch_Aggregate_Slowdown - Fatal编程技术网 elasticsearch,aggregate,slowdown,Performance,elasticsearch,Aggregate,Slowdown" /> elasticsearch,aggregate,slowdown,Performance,elasticsearch,Aggregate,Slowdown" />

Performance 弹性搜索:聚合查询非常慢

Performance 弹性搜索:聚合查询非常慢,performance,elasticsearch,aggregate,slowdown,Performance,elasticsearch,Aggregate,Slowdown,下面的聚合查询用于在10秒内运行。突然间,它需要5分钟以上才能完成。不知道发生了什么变化 查询: time curl -XGET http://localhost:9200/metric_alias/metrics/_search\?pretty\&routing\=123456 -d '{ "size": 0, "query": { "bool": { "must": [ { "te

下面的聚合查询用于在10秒内运行。突然间,它需要5分钟以上才能完成。不知道发生了什么变化

查询:

    time curl -XGET http://localhost:9200/metric_alias/metrics/_search\?pretty\&routing\=123456 -d '{
      "size": 0,
      "query": { 
        "bool": { 
          "must": [ { 
               "term": { 
                  "tenantId": 123456 
               } 
             }, 
                { 
                "regexp": { 
                   "metric_name": {
                       "value": "[^.]*[.][^.]*" 
                   } 
                } 
             } ] 
          } 
       },
      "aggs": {
          "metric_name_tokens": {
              "terms": {
                  "field" : "metric_name",
                  "include": "[^.]*[.][^.]*",
                  "execution_hint": "map",
                  "size": 0
              }
          }
      }
  }' -o test.out
我甚至尝试在使用下面的命令清除字段数据缓存后运行查询

curl -XPOST 'http://localhost:9200/_cache/clear' -d '{ "fielddata": "true" }'
几个月前,我们更改了这些设置。不要相信我们看到的问题与此相关,因为即使在清除字段数据缓存后也会发生这种情况

indices.breaker.fielddata.limit is set to 85%
indices.fielddata.cache.size is set to 75%
我在查询运行时录制了热线程。我在这里复制了输出

关于如何调试这个问题有什么想法吗

环境:弹性搜索1.7.1。它是一个具有125G RAM和40个内核的3节点集群。ES以31G的堆大小运行。metric_alias仅涉及2个索引(其中一个不再更新)。大约20GB的数据。运行查询时,我看不到CPU和堆的使用有任何不同。

根据

索引.fielddata.cache.size
索引.breaker.fielddata.limit
之间的关系非常重要。如果断路器限制低于缓存大小,则不会逐出任何数据。为使其正常工作,断路器限制必须高于缓存大小

我认为您的
索引.breaker.total.limit
未设置,默认为
70%
。因此,即使您的
index.breaker.fielddata.limit
设置为
85%
index.breaker.total.limit
也限制了其功能

指数.断路器.总计.限值
: total断路器包装请求断路器和fielddata断路器,以确保在默认情况下,两者的组合不会使用超过堆的70%

尝试:

  • 索引.breaker.fielddata.limit增加到
    >85%
  • 减少
    索引.breaker.fielddata.limit
    索引.fielddata.cache.size
    小于
    60%
    ,因为为什么单个查询需要堆的60%以上

  • 评论不用于扩展讨论;这段对话已经结束。
    indices.breaker.fielddata.limit is set to 85%
    indices.fielddata.cache.size is set to 75%