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
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.