如何监视滚动API为每个滚动ID使用的资源?调用clearScroll Api时会发生什么 [英] How to monitor resources used by scroll API for each scroll Id? what happens when clearScroll Api is called

查看:114
本文介绍了如何监视滚动API为每个滚动ID使用的资源?调用clearScroll Api时会发生什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何针对每个滚动ID监视滚动API所使用的内存资源或搜索上下文?这些搜索上下文存储在哪里,有没有办法查看或监视它们?参数keepAlive对Java api公共SearchRequest scroll(TimeValue keepAlive){...}

How to monitor memory resources or search contexts used by scroll API for each scroll Id? where does these search contexts are stored, is there a way to see or monitor them? what does the parameter keepAlive mean for the java api public SearchRequest scroll(TimeValue keepAlive) {...}

Ref: https ://www.elastic.co/guide/zh-CN/elasticsearch/client/java-rest/6.5/java-rest-high-clear-scroll.html#java-rest-high-clear-scroll-async

推荐答案

您可以通过调用节点统计信息API ,但是(我知道)无法查看有多少内存由他们使用:

You can check how many search contexts are currently opened by calling the Node stats API but there's no way (that I know of) to see how much memory is used by them:

GET _nodes/stats/indices?filter_path=**.open_contexts

=>

{
  "nodes" : {
    "QjjWj45NQkGC9qcaylDDVQ" : {
      "indices" : {
        "search" : {
          "open_contexts" : 0
        }
      }
    },
    "eZbpkckXSxSxzD8c_QOkEA" : {
      "indices" : {
        "search" : {
          "open_contexts" : 3
        }
      }
    },
    "0VFJaC2uTraudPCMqODhiw" : {
      "indices" : {
        "search" : {
          "open_contexts" : 2
        }
      }
    }
  }
}

搜索上下文存储在堆中。

The search contexts are stored on the heap.

此外, keepAlive 参数告诉上下文在自动清除之前在内存中保持可用状态的时间。

Furthermore, the keepAlive parameter tells how long the context stays available in memory before being cleared automatically.

这篇关于如何监视滚动API为每个滚动ID使用的资源?调用clearScroll Api时会发生什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆