forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: zhengxiu <zhengxiu@huawei.com> Co-committed-by: zhengxiu <zhengxiu@huawei.com>
252 lines
28 KiB
HTML
252 lines
28 KiB
HTML
<a name="css_01_0408"></a><a name="css_01_0408"></a>
|
||
|
||
<h1 class="topictitle1">Configuring Large Query Isolation for an Elasticsearch Cluster</h1>
|
||
<div id="body0000001225857867"><div class="section" id="css_01_0408__section7417195582813"><h4 class="sectiontitle">Scenario</h4><p id="css_01_0408__p3938125711281">You can isolate query requests that consume a large amount of memory or take a long period of time. This way, you ensure service availability for other requests. If the heap memory usage of a node is too high, an interrupt control program will be triggered to terminate a large query based on the policies you configured. You can also configure a global query timeout duration. Long queries will be intercepted by an Elasticsearch-native cancel API.</p>
|
||
<div class="p" id="css_01_0408__p9911436153215">Large query isolation can effectively solve the following problems and improve the search performance of clusters:<ul id="css_01_0408__en-us_topic_0000001223914392_ul2627173217595"><li id="css_01_0408__en-us_topic_0000001223914392_li20627153218599">A small number of queries occupy large chunks of node heap memory, resulting in frequent Garbage Collection (GC) and even out of memory (OOM) exceptions.</li><li id="css_01_0408__en-us_topic_0000001223914392_li1447142015010">Frequent GC causes node disconnections. As a result, queries cannot get response and may fail.</li><li id="css_01_0408__en-us_topic_0000001223914392_li460219571721">The CPU usage is high due to heavy query load, affecting online services.</li></ul>
|
||
</div>
|
||
</div>
|
||
<div class="section" id="css_01_0408__section174119599287"><h4 class="sectiontitle">Constraints</h4><p id="css_01_0408__p6662155817386">Only Elasticsearch 7.6.2 and Elasticsearch 7.10.2 clusters support large query isolation.</p>
|
||
</div>
|
||
<div class="section" id="css_01_0408__section191305215291"><h4 class="sectiontitle">Configuring Large Query Isolation</h4><p id="css_01_0408__en-us_topic_0000001223914380_p8060118">Large query isolation is enabled by default, while the global timeout duration is disabled by default. If you enable them, the configuration will take effect immediately.</p>
|
||
<ol id="css_01_0408__en-us_topic_0000001223914380_ol967455532214"><li id="css_01_0408__en-us_topic_0000001223914380_li1274916552817">Log in to the CSS management console.</li><li id="css_01_0408__en-us_topic_0000001223914380_li1567425552219">Choose <strong id="css_01_0408__b195246085511325">Clusters</strong> in the navigation pane. On the <strong id="css_01_0408__b1581441211325">Clusters</strong> page, locate the target cluster, and click <strong id="css_01_0408__b99478494611325">Access Kibana</strong> in the <strong id="css_01_0408__b91108106111325">Operation</strong> column.</li><li id="css_01_0408__en-us_topic_0000001223914380_li1167465522219">In the navigation pane of Kibana on the left, choose <strong id="css_01_0408__b1298661666">Dev Tools</strong>. Run the following command to enable large query isolation and global timeout features:<pre class="screen" id="css_01_0408__en-us_topic_0000001223914380_screen066912558220">PUT _cluster/settings
|
||
{
|
||
"persistent": {
|
||
"search.isolator.enabled": true,
|
||
"search.isolator.time.enabled": true
|
||
}
|
||
}</pre>
|
||
<p id="css_01_0408__en-us_topic_0000001223914380_p1224053385116">The two features each has an independent switch. <a href="#css_01_0408__en-us_topic_0000001223914380_table449913935218">Table 1</a> describes their parameters.</p>
|
||
|
||
<div class="tablenoborder"><a name="css_01_0408__en-us_topic_0000001223914380_table449913935218"></a><a name="en-us_topic_0000001223914380_table449913935218"></a><table cellpadding="4" cellspacing="0" summary="" id="css_01_0408__en-us_topic_0000001223914380_table449913935218" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters for large query isolation and global timeout duration</caption><thead align="left"><tr id="css_01_0408__en-us_topic_0000001223914380_row19499699527"><th align="left" class="cellrowborder" valign="top" width="22.81%" id="mcps1.3.3.3.3.4.2.4.1.1"><p id="css_01_0408__en-us_topic_0000001223914380_p17499799526">Switch</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="32.1%" id="mcps1.3.3.3.3.4.2.4.1.2"><p id="css_01_0408__en-us_topic_0000001223914380_p1749914985220">Parameter</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="45.09%" id="mcps1.3.3.3.3.4.2.4.1.3"><p id="css_01_0408__en-us_topic_0000001223914380_p24991696520">Description</p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="css_01_0408__en-us_topic_0000001223914380_row164993911523"><td class="cellrowborder" rowspan="3" valign="top" width="22.81%" headers="mcps1.3.3.3.3.4.2.4.1.1 "><p id="css_01_0408__en-us_topic_0000001223914380_p349911925216">search.isolator.enabled</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="32.1%" headers="mcps1.3.3.3.3.4.2.4.1.2 "><p id="css_01_0408__en-us_topic_0000001223914380_p749919185216">search.isolator.memory.task.limit</p>
|
||
<p id="css_01_0408__en-us_topic_0000001223914380_p1849914914527">search.isolator.time.management</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="45.09%" headers="mcps1.3.3.3.3.4.2.4.1.3 "><p id="css_01_0408__en-us_topic_0000001223914380_p349979105210">Thresholds of a shard query task. A query task exceeding one of these thresholds is identified as a large query.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0408__en-us_topic_0000001223914380_row204993925218"><td class="cellrowborder" valign="top" headers="mcps1.3.3.3.3.4.2.4.1.1 "><p id="css_01_0408__en-us_topic_0000001223914380_p15499091528">search.isolator.memory.pool.limit</p>
|
||
<p id="css_01_0408__en-us_topic_0000001223914380_p1149915910523">search.isolator.memory.heap.limit</p>
|
||
<p id="css_01_0408__en-us_topic_0000001223914380_p164992091529">search.isolator.count.limit</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" headers="mcps1.3.3.3.3.4.2.4.1.2 "><p id="css_01_0408__en-us_topic_0000001223914380_p2049914935214">Resource usage thresholds for isolation. If the resource usage of a query task exceeds one of these thresholds, the task will be interrupted.</p>
|
||
<div class="note" id="css_01_0408__en-us_topic_0000001223914380_note1582782844219"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="css_01_0408__en-us_topic_0000001223914380_p3743123154210"><span class="parmname" id="css_01_0408__en-us_topic_0000001223914380_parmname14867422141414"><b>search.isolator.memory.heap.limit</b></span> defines the limit on the heap memory consumed by write, query, and other operations of a node. If this limit is exceeded, large query tasks in the isolation pool will be interrupted.</p>
|
||
</div></div>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0408__en-us_topic_0000001223914380_row1749920911521"><td class="cellrowborder" valign="top" headers="mcps1.3.3.3.3.4.2.4.1.1 "><p id="css_01_0408__en-us_topic_0000001223914380_p2499995526">search.isolator.strategy</p>
|
||
<p id="css_01_0408__en-us_topic_0000001223914380_p54995905212">search.isolator.strategy.ratio</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" headers="mcps1.3.3.3.3.4.2.4.1.2 "><p id="css_01_0408__en-us_topic_0000001223914380_p049916913523">Policy for selecting query tasks to pause in the isolation pool.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0408__en-us_topic_0000001223914380_row15499149175217"><td class="cellrowborder" valign="top" width="22.81%" headers="mcps1.3.3.3.3.4.2.4.1.1 "><p id="css_01_0408__en-us_topic_0000001223914380_p114990919521">search.isolator.time.enabled</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="32.1%" headers="mcps1.3.3.3.3.4.2.4.1.2 "><p id="css_01_0408__en-us_topic_0000001223914380_p1749999125217">search.isolator.time.limit</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="45.09%" headers="mcps1.3.3.3.3.4.2.4.1.3 "><p id="css_01_0408__en-us_topic_0000001223914380_p649911955216">Global timeout interval of query tasks.</p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</li><li id="css_01_0408__en-us_topic_0000001223914380_li19670121125619">Configure large query isolation.<ul id="css_01_0408__en-us_topic_0000001223914380_ul76635460577"><li id="css_01_0408__en-us_topic_0000001223914380_li1866374618577">Run the following commands to configure thresholds for defining a large query task:<pre class="screen" id="css_01_0408__en-us_topic_0000001223914380_screen88675403576">PUT _cluster/settings
|
||
{
|
||
"persistent": {
|
||
"search.isolator.memory.task.limit": "50MB",
|
||
"search.isolator.time.management": "10s"
|
||
}
|
||
}</pre>
|
||
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0408__en-us_topic_0000001223914380_table198688407575" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="css_01_0408__en-us_topic_0000001223914380_row186804045710"><th align="left" class="cellrowborder" valign="top" width="25.319999999999997%" id="mcps1.3.3.3.4.1.1.2.2.4.1.1"><p id="css_01_0408__en-us_topic_0000001223914380_p10868134016570">Parameter</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="11.18%" id="mcps1.3.3.3.4.1.1.2.2.4.1.2"><p id="css_01_0408__en-us_topic_0000001223914380_p3868740135716">Data Type</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="63.5%" id="mcps1.3.3.3.4.1.1.2.2.4.1.3"><p id="css_01_0408__en-us_topic_0000001223914380_p1986817406579">Description</p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="css_01_0408__en-us_topic_0000001223914380_row1086814018574"><td class="cellrowborder" valign="top" width="25.319999999999997%" headers="mcps1.3.3.3.4.1.1.2.2.4.1.1 "><p id="css_01_0408__en-us_topic_0000001223914380_p18868164018578">search.isolator.memory.task.limit</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="11.18%" headers="mcps1.3.3.3.4.1.1.2.2.4.1.2 "><p id="css_01_0408__en-us_topic_0000001223914380_p1886834015718">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="63.5%" headers="mcps1.3.3.3.4.1.1.2.2.4.1.3 "><p id="css_01_0408__en-us_topic_0000001223914380_p68688406571">Threshold of the memory requested by a query task to perform aggregation or other operations. If the requested memory exceeds the threshold, the task will be isolated and observed.</p>
|
||
<ul id="css_01_0408__ul320525512357"><li id="css_01_0408__li14205185510358">Value range: <strong id="css_01_0408__b81660824011325">0b</strong> to the maximum heap memory of a node</li><li id="css_01_0408__li1520511554356">Default value: <strong id="css_01_0408__b88020801111325">50MB</strong></li></ul>
|
||
<div class="note" id="css_01_0408__en-us_topic_0000001223914380_note138681040105715"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="css_01_0408__en-us_topic_0000001223914380_p11868040135720">You can run the following command to query the current heap memory and the maximum heap memory of a cluster:</p>
|
||
<p id="css_01_0408__en-us_topic_0000001223914380_p786820402571"><b><span class="cmdname" id="css_01_0408__en-us_topic_0000001223914380_cmdname138681340165715">GET _cat/nodes?&h=id,ip,port,r,ramPercent,ramCurrent,heapMax,heapCurrent</span></b></p>
|
||
</div></div>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0408__en-us_topic_0000001223914380_row15868840105711"><td class="cellrowborder" valign="top" width="25.319999999999997%" headers="mcps1.3.3.3.4.1.1.2.2.4.1.1 "><p id="css_01_0408__en-us_topic_0000001223914380_p13868340185715">search.isolator.time.management</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="11.18%" headers="mcps1.3.3.3.4.1.1.2.2.4.1.2 "><p id="css_01_0408__en-us_topic_0000001223914380_p128682401575">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="63.5%" headers="mcps1.3.3.3.4.1.1.2.2.4.1.3 "><p id="css_01_0408__en-us_topic_0000001223914380_p78681408578">Threshold of the duration of a query (started when cluster resources are used for query). If the duration of a query exceeds the threshold, it will be isolated and observed.</p>
|
||
<ul id="css_01_0408__ul1147474163617"><li id="css_01_0408__li154741545368">Value range: ≥ <strong id="css_01_0408__b32504079611325">0ms</strong></li><li id="css_01_0408__li134744418361">Default value: <strong id="css_01_0408__b1429178102312">10s</strong></li></ul>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</li><li id="css_01_0408__en-us_topic_0000001223914380_li13598961599">Configure the resource usage thresholds for triggering the isolation of query tasks.<pre class="screen" id="css_01_0408__en-us_topic_0000001223914380_screen1159818685917">PUT _cluster/settings
|
||
{
|
||
"persistent": {
|
||
"search.isolator.memory.pool.limit": "50%",
|
||
"search.isolator.memory.heap.limit": "90%",
|
||
"search.isolator.count.limit": 1000
|
||
}
|
||
}</pre>
|
||
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0408__en-us_topic_0000001223914380_table2598162594" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Parameter description</caption><thead align="left"><tr id="css_01_0408__en-us_topic_0000001223914380_row1759820617598"><th align="left" class="cellrowborder" valign="top" width="25.319999999999997%" id="mcps1.3.3.3.4.1.2.2.2.4.1.1"><p id="css_01_0408__en-us_topic_0000001223914380_p155984665916">Parameter</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="11.18%" id="mcps1.3.3.3.4.1.2.2.2.4.1.2"><p id="css_01_0408__en-us_topic_0000001223914380_p115985655915">Data Type</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="63.5%" id="mcps1.3.3.3.4.1.2.2.2.4.1.3"><p id="css_01_0408__en-us_topic_0000001223914380_p1059810611598">Description</p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="css_01_0408__en-us_topic_0000001223914380_row1059816615599"><td class="cellrowborder" valign="top" width="25.319999999999997%" headers="mcps1.3.3.3.4.1.2.2.2.4.1.1 "><p id="css_01_0408__en-us_topic_0000001223914380_p17598861596">search.isolator.memory.pool.limit</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="11.18%" headers="mcps1.3.3.3.4.1.2.2.2.4.1.2 "><p id="css_01_0408__en-us_topic_0000001223914380_p6598763597">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="63.5%" headers="mcps1.3.3.3.4.1.2.2.2.4.1.3 "><p id="css_01_0408__en-us_topic_0000001223914380_p05981468599">Threshold of the heap memory percentage of the current node. If the total memory requested by large query tasks in the isolation pool exceeds the threshold, the interrupt control program will be triggered to cancel one of the tasks.</p>
|
||
<ul id="css_01_0408__ul4294131073618"><li id="css_01_0408__li1029441013362">Value range: <strong id="css_01_0408__b55629693211325">0.0</strong> to <strong id="css_01_0408__b37147400911325">100.0%</strong></li><li id="css_01_0408__li1429481014367">Default value: <strong id="css_01_0408__b123986728911325">50%</strong></li></ul>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0408__en-us_topic_0000001223914380_row1159812655913"><td class="cellrowborder" valign="top" width="25.319999999999997%" headers="mcps1.3.3.3.4.1.2.2.2.4.1.1 "><p id="css_01_0408__en-us_topic_0000001223914380_p859813615915">search.isolator.memory.heap.limit</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="11.18%" headers="mcps1.3.3.3.4.1.2.2.2.4.1.2 "><p id="css_01_0408__en-us_topic_0000001223914380_p8598206165917">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="63.5%" headers="mcps1.3.3.3.4.1.2.2.2.4.1.3 "><p id="css_01_0408__en-us_topic_0000001223914380_p25981969595">Heap memory threshold of the current node. If the heap memory of the node exceeds the threshold, the interrupt control program will be triggered to cancel a large query task in the isolation pool.</p>
|
||
<ul id="css_01_0408__ul6851228163611"><li id="css_01_0408__li18562810362">Value range: <strong id="css_01_0408__b2686651611325">0.0</strong> to <strong id="css_01_0408__b31454809711325">100.0%</strong></li><li id="css_01_0408__li185928163618">Default value: <strong id="css_01_0408__b54260103611325">90%</strong></li></ul>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0408__en-us_topic_0000001223914380_row45981269593"><td class="cellrowborder" valign="top" width="25.319999999999997%" headers="mcps1.3.3.3.4.1.2.2.2.4.1.1 "><p id="css_01_0408__en-us_topic_0000001223914380_p35981667593">search.isolator.count.limit</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="11.18%" headers="mcps1.3.3.3.4.1.2.2.2.4.1.2 "><p id="css_01_0408__en-us_topic_0000001223914380_p1959818655919">Integer</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="63.5%" headers="mcps1.3.3.3.4.1.2.2.2.4.1.3 "><p id="css_01_0408__en-us_topic_0000001223914380_p16598467598">Threshold of the number of large query tasks in the current node isolation pool. If the number of observed query tasks exceeds the threshold, the interrupt control program will be triggered to stop accepting new large queries. New large query requests will be directly canceled.</p>
|
||
<ul id="css_01_0408__ul126131113615"><li id="css_01_0408__li166531173620">Value range: <strong id="css_01_0408__b106202835511325">10</strong>–<strong id="css_01_0408__b131723207711325">50000</strong></li><li id="css_01_0408__li1669312366">Default value: <strong id="css_01_0408__b168343721611325">1000</strong></li></ul>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<div class="note" id="css_01_0408__en-us_topic_0000001223914380_note125314375419"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="css_01_0408__en-us_topic_0000001223914380_p7259106114218">In addition to <span class="parmname" id="css_01_0408__parmname11887666411325"><b>search.isolator.memory.pool.limit</b></span> and <span class="parmname" id="css_01_0408__parmname71675397411325"><b>search.isolator.count.limit</b></span> parameters, you can configure <span class="parmname" id="css_01_0408__parmname116505225311325"><b>search.isolator.memory.task.limit</b></span> and <span class="parmname" id="css_01_0408__parmname47363958211325"><b>search.isolator.time.management</b></span> to control the number of query tasks that enter the isolation pool.</p>
|
||
</div></div>
|
||
</li><li id="css_01_0408__en-us_topic_0000001223914380_li1976553255913">Configure a policy for selecting query tasks to pause in the isolation pool.<pre class="screen" id="css_01_0408__en-us_topic_0000001223914380_screen107651332145916">PUT _cluster/settings
|
||
{
|
||
"persistent": {
|
||
"search.isolator.strategy": "fair",
|
||
"search.isolator.strategy.ratio": "0.5%"
|
||
}
|
||
}</pre>
|
||
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0408__en-us_topic_0000001223914380_table2765203255916" frame="border" border="1" rules="all"><thead align="left"><tr id="css_01_0408__en-us_topic_0000001223914380_row16765163210597"><th align="left" class="cellrowborder" valign="top" width="25.319999999999997%" id="mcps1.3.3.3.4.1.3.2.1.4.1.1"><p id="css_01_0408__en-us_topic_0000001223914380_p5765123285917">Parameter</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="11.18%" id="mcps1.3.3.3.4.1.3.2.1.4.1.2"><p id="css_01_0408__en-us_topic_0000001223914380_p576563245911">Data Type</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="63.5%" id="mcps1.3.3.3.4.1.3.2.1.4.1.3"><p id="css_01_0408__en-us_topic_0000001223914380_p1676523219598">Description</p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="css_01_0408__en-us_topic_0000001223914380_row376563265914"><td class="cellrowborder" valign="top" width="25.319999999999997%" headers="mcps1.3.3.3.4.1.3.2.1.4.1.1 "><p id="css_01_0408__en-us_topic_0000001223914380_p1376553220593">search.isolator.strategy</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="11.18%" headers="mcps1.3.3.3.4.1.3.2.1.4.1.2 "><p id="css_01_0408__en-us_topic_0000001223914380_p376517320596">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="63.5%" headers="mcps1.3.3.3.4.1.3.2.1.4.1.3 "><p id="css_01_0408__en-us_topic_0000001223914380_p107655327598">Policy for selecting large queries when the interrupt control program is triggered. The selected queries will be interrupted.</p>
|
||
<div class="note" id="css_01_0408__en-us_topic_0000001223914380_note1076583217592"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="css_01_0408__en-us_topic_0000001223914380_p976543217594">The large query isolation pool is checked every second until the heap memory is within the safe range.</p>
|
||
</div></div>
|
||
<div class="p" id="css_01_0408__en-us_topic_0000001223914380_p4765203205914">Values: <strong id="css_01_0408__b39667412211325">fair</strong>, <strong id="css_01_0408__b61916116111325">mem-first</strong>, or <strong id="css_01_0408__b115087448111325">time-first</strong><ul id="css_01_0408__en-us_topic_0000001223914380_ul976515327591"><li id="css_01_0408__en-us_topic_0000001223914380_li137651732135913"><strong id="css_01_0408__b47704680511325">mem-first</strong>: The query task that uses the most heap memory in the isolation pool is interrupted.</li><li id="css_01_0408__en-us_topic_0000001223914380_li167650326590"><strong id="css_01_0408__b53721171211325">time-first</strong>: The query task that has been running for the longest time in the isolation pool is interrupted.</li><li id="css_01_0408__en-us_topic_0000001223914380_li1676511321591"><strong id="css_01_0408__b172140948511325">fair</strong>: If the difference between the heap memory of shard queries is smaller than <em id="css_01_0408__i211136910811325">Maximum_heap_memory</em> x <strong id="css_01_0408__b34878028111325">search.isolator.strategy.ratio</strong>, the query that takes the longest time should be interrupted. Otherwise, the query that uses the most heap memory is interrupted.</li></ul>
|
||
</div>
|
||
<p id="css_01_0408__en-us_topic_0000001223914380_p776518329595">Default value: <strong id="css_01_0408__b198365660211325">fair</strong></p>
|
||
</td>
|
||
</tr>
|
||
<tr id="css_01_0408__en-us_topic_0000001223914380_row776673265916"><td class="cellrowborder" valign="top" width="25.319999999999997%" headers="mcps1.3.3.3.4.1.3.2.1.4.1.1 "><p id="css_01_0408__en-us_topic_0000001223914380_p2766113211591">search.isolator.strategy.ratio</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="11.18%" headers="mcps1.3.3.3.4.1.3.2.1.4.1.2 "><p id="css_01_0408__en-us_topic_0000001223914380_p776633218593">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="63.5%" headers="mcps1.3.3.3.4.1.3.2.1.4.1.3 "><p id="css_01_0408__en-us_topic_0000001223914380_p19766532105913">Threshold of the <strong id="css_01_0408__b149233042211325">fair</strong> policy. This parameter takes effect only if <strong id="css_01_0408__b140793405011325">search.isolator.strategy</strong> is set to <strong id="css_01_0408__b19105467511325">fair</strong>. If the difference between the memory usage of large query tasks does not exceed the threshold, the query that takes the longest time should be interrupted. If the difference between the memory usage of large query tasks exceeds the threshold, the query that uses the most memory is interrupted.</p>
|
||
<ul id="css_01_0408__ul1503174013610"><li id="css_01_0408__li1503114018362">Value range: <strong id="css_01_0408__b88317938911325">0.0</strong> to <strong id="css_01_0408__b191753926611325">100.0%</strong></li><li id="css_01_0408__li650315405361">Default value: <strong id="css_01_0408__b188008681511325">1%</strong></li></ul>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</li></ul>
|
||
</li><li id="css_01_0408__li1248122854319">Configure the global timeout duration of query tasks.<div class="p" id="css_01_0408__p1068602874316"><a name="css_01_0408__li1248122854319"></a><a name="li1248122854319"></a>Run the following command to set the global timeout of query tasks:<pre class="screen" id="css_01_0408__en-us_topic_0000001223914380_screen13694144910596">PUT _cluster/settings
|
||
{
|
||
"persistent": {
|
||
"search.isolator.time.limit": "120s"
|
||
}
|
||
}</pre>
|
||
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0408__en-us_topic_0000001223914380_table17191611509" frame="border" border="1" rules="all"><thead align="left"><tr id="css_01_0408__en-us_topic_0000001223914380_row181911213010"><th align="left" class="cellrowborder" valign="top" width="29.67%" id="mcps1.3.3.3.5.1.2.1.4.1.1"><p id="css_01_0408__en-us_topic_0000001223914380_p15191115016">Parameter</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="11.32%" id="mcps1.3.3.3.5.1.2.1.4.1.2"><p id="css_01_0408__en-us_topic_0000001223914380_p51911111205">Data Type</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="59.01%" id="mcps1.3.3.3.5.1.2.1.4.1.3"><p id="css_01_0408__en-us_topic_0000001223914380_p61911118012">Description</p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="css_01_0408__en-us_topic_0000001223914380_row111911815017"><td class="cellrowborder" valign="top" width="29.67%" headers="mcps1.3.3.3.5.1.2.1.4.1.1 "><p id="css_01_0408__en-us_topic_0000001223914380_p81911019017">search.isolator.time.limit</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="11.32%" headers="mcps1.3.3.3.5.1.2.1.4.1.2 "><p id="css_01_0408__en-us_topic_0000001223914380_p1619117115016">String</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="59.01%" headers="mcps1.3.3.3.5.1.2.1.4.1.3 "><p id="css_01_0408__en-us_topic_0000001223914380_p51911814013">Global query timeout duration. Any query task that exceeds this duration will be canceled.</p>
|
||
<ul id="css_01_0408__ul849264683617"><li id="css_01_0408__li154921746103611">Value range: ≥ <strong id="css_01_0408__b187926155011325">0ms</strong></li><li id="css_01_0408__li34921346103610">Default value: <strong id="css_01_0408__b168001521211325">120s</strong></li></ul>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</li><li id="css_01_0408__li98581810870">Configure logging for <strong id="css_01_0408__b14475191102117">cancel task</strong>.<div class="p" id="css_01_0408__p6669162710912">Run the following command to set the maximum number of <strong id="css_01_0408__b193283247214">cancel task</strong> log records.<pre class="screen" id="css_01_0408__screen666912717916">PUT _cluster/settings
|
||
{
|
||
"persistent": {
|
||
"search.isolator.log.count": "100s"
|
||
}
|
||
}</pre>
|
||
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0408__table366922710914" frame="border" border="1" rules="all"><thead align="left"><tr id="css_01_0408__row466920278911"><th align="left" class="cellrowborder" valign="top" width="29.67%" id="mcps1.3.3.3.6.2.3.1.4.1.1"><p id="css_01_0408__p20669152719914">Parameter</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="11.32%" id="mcps1.3.3.3.6.2.3.1.4.1.2"><p id="css_01_0408__p266910271390">Data Type</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="59.01%" id="mcps1.3.3.3.6.2.3.1.4.1.3"><p id="css_01_0408__p1167017271393">Description</p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="css_01_0408__row967014279916"><td class="cellrowborder" valign="top" width="29.67%" headers="mcps1.3.3.3.6.2.3.1.4.1.1 "><p id="css_01_0408__p1367012713918">search.isolator.log.count</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="11.32%" headers="mcps1.3.3.3.6.2.3.1.4.1.2 "><p id="css_01_0408__p667062717914">Integer</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="59.01%" headers="mcps1.3.3.3.6.2.3.1.4.1.3 "><p id="css_01_0408__p106707273910">Maximum number of records of canceled query requests that can be recorded in the memory.</p>
|
||
<ul id="css_01_0408__ul196704271492"><li id="css_01_0408__li15670627498">Value range: 0–5000</li><li id="css_01_0408__li1267092710911">Default value: <strong id="css_01_0408__b127627921882153">100</strong></li></ul>
|
||
<div class="note" id="css_01_0408__note1128572216171"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="css_01_0408__p182851922131720">You can use the following APIs to query canceled requests:</p>
|
||
<ul id="css_01_0408__ul1158011536811"><li id="css_01_0408__li105809531489">GET /_isolator_metrics: Queries all nodes.</li><li id="css_01_0408__li0580105310818">GET /_isolator_metrics/{nodeId}: Queries a single node.</li><li id="css_01_0408__li15810531819">GET /_isolator_metrics? detailed: Queries request cancellation details of all nodes.</li><li id="css_01_0408__li145819531381">GET /_isolator_metrics/{nodeId}?detailed: Queries request cancellation details of a single node.</li></ul>
|
||
<p id="css_01_0408__p15230131502817">In the commands above, <strong id="css_01_0408__b1873573717251">nodeId</strong> indicates the node ID.</p>
|
||
</div></div>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</li></ol>
|
||
</div>
|
||
</div>
|
||
<div>
|
||
<div class="familylinks">
|
||
<div class="parentlink"><strong>Parent topic:</strong> <a href="css_01_0111.html">Enhancing Search Capabilities for Elasticsearch Clusters</a></div>
|
||
</div>
|
||
</div>
|
||
|