How to monitor resources used by scroll API for each scroll Id? what happens when clearScroll Api is called

前端 未结 1 998
南方客
南方客 2021-01-28 20:59

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? wha

相关标签:
1条回答
  • 2021-01-28 21:44

    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.

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

    0 讨论(0)
提交回复
热议问题