doc-exports/docs/css/umn/css_01_0194.html
Wuwan, Qi 050b395397 CSS UMN 23.2.1 20230926
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com>
Co-authored-by: Wuwan, Qi <wuwanqi1@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-committed-by: Wuwan, Qi <wuwanqi1@noreply.gitea.eco.tsi-dev.otc-service.com>
2024-01-10 14:23:15 +00:00

105 lines
14 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<a name="css_01_0194"></a><a name="css_01_0194"></a>
<h1 class="topictitle1">Memory Flow Control</h1>
<div id="body0000001485373445"><div class="section" id="css_01_0194__en-us_topic_0000001485373445_section2344204318530"><h4 class="sectiontitle">Context</h4><p id="css_01_0194__en-us_topic_0000001485373445_p7185363169">Elasticsearch provides a circuit breaker, which will terminate requests or return the error code <strong id="css_01_0194__en-us_topic_0000001485373445_b49600205415">429</strong> if the memory usage exceeds its threshold. However, the circuit breaker rejects a request only after the node reads the entire request, which occupies heap memory. To prevent a request from being fully received by a node before the request is rejected, you can control the client traffic based on the real-time status of the node heap memory.</p>
</div>
<div class="section" id="css_01_0194__en-us_topic_0000001485373445_section15798243503"><h4 class="sectiontitle">Configuring Parameters</h4><p id="css_01_0194__en-us_topic_0000001485373445_p2711624155017">The following table describes memory flow control parameters.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0194__en-us_topic_0000001485373445_table1376624125014" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Memory flow control parameters</caption><thead align="left"><tr id="css_01_0194__en-us_topic_0000001485373445_row071224195017"><th align="left" class="cellrowborder" valign="top" width="29.472947294729472%" id="mcps1.3.2.3.2.4.1.1"><p id="css_01_0194__en-us_topic_0000001485373445_p147182455018">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.251625162516252%" id="mcps1.3.2.3.2.4.1.2"><p id="css_01_0194__en-us_topic_0000001485373445_p187122413507">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="54.27542754275427%" id="mcps1.3.2.3.2.4.1.3"><p id="css_01_0194__en-us_topic_0000001485373445_p471152425019">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="css_01_0194__en-us_topic_0000001485373445_row1772172425018"><td class="cellrowborder" valign="top" width="29.472947294729472%" headers="mcps1.3.2.3.2.4.1.1 "><p id="css_01_0194__en-us_topic_0000001485373445_p1172924155011">flowcontrol.memory.enabled</p>
</td>
<td class="cellrowborder" valign="top" width="16.251625162516252%" headers="mcps1.3.2.3.2.4.1.2 "><p id="css_01_0194__en-us_topic_0000001485373445_p3721024155016">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="54.27542754275427%" headers="mcps1.3.2.3.2.4.1.3 "><p id="css_01_0194__en-us_topic_0000001485373445_p107210242506">Whether to enable memory flow control. After this function is enabled, the memory usage is continuously monitored. The value can be:</p>
<ul id="css_01_0194__en-us_topic_0000001485373445_ul57202413502"><li id="css_01_0194__en-us_topic_0000001485373445_li177262415018"><strong id="css_01_0194__en-us_topic_0000001485373445_b977817191914">true</strong></li><li id="css_01_0194__en-us_topic_0000001485373445_li6721124185015"><strong id="css_01_0194__en-us_topic_0000001485373445_b655105717418">false</strong> (default value)</li></ul>
</td>
</tr>
<tr id="css_01_0194__en-us_topic_0000001485373445_row1673162455019"><td class="cellrowborder" valign="top" width="29.472947294729472%" headers="mcps1.3.2.3.2.4.1.1 "><p id="css_01_0194__en-us_topic_0000001485373445_p57262417501">flowcontrol.memory.heap_limit</p>
</td>
<td class="cellrowborder" valign="top" width="16.251625162516252%" headers="mcps1.3.2.3.2.4.1.2 "><p id="css_01_0194__en-us_topic_0000001485373445_p77212248507">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.27542754275427%" headers="mcps1.3.2.3.2.4.1.3 "><p id="css_01_0194__en-us_topic_0000001485373445_p107262465010">Maximum global heap memory usage of a node. If the value of this parameter is exceeded, traffic backpressure is performed.</p>
<p id="css_01_0194__en-us_topic_0000001485373445_p872182485012">Value range: 10%100%</p>
<p id="css_01_0194__en-us_topic_0000001485373445_p772324105019">Default value: <strong id="css_01_0194__en-us_topic_0000001485373445_b18220391569">90%</strong></p>
</td>
</tr>
<tr id="css_01_0194__en-us_topic_0000001485373445_row107342416503"><td class="cellrowborder" valign="top" width="29.472947294729472%" headers="mcps1.3.2.3.2.4.1.1 "><p id="css_01_0194__en-us_topic_0000001485373445_p12739246508">flowcontrol.holding.in_flight_factor</p>
</td>
<td class="cellrowborder" valign="top" width="16.251625162516252%" headers="mcps1.3.2.3.2.4.1.2 "><p id="css_01_0194__en-us_topic_0000001485373445_p6731224185015">Float</p>
</td>
<td class="cellrowborder" valign="top" width="54.27542754275427%" headers="mcps1.3.2.3.2.4.1.3 "><p id="css_01_0194__en-us_topic_0000001485373445_p27362416506">Backpressure release factor. The principle is similar to that of the circuit breaker parameter <strong id="css_01_0194__en-us_topic_0000001485373445_b828115213131">network.breaker.inflight_requests.overhead</strong>. When the memory usage reaches the limit, a larger value indicates stronger backpressure. The write traffic will be limited.</p>
<p id="css_01_0194__en-us_topic_0000001485373445_p11731324155015">Value range: ≥ 0.5</p>
<p id="css_01_0194__en-us_topic_0000001485373445_p1473122417506">Default value: <strong id="css_01_0194__en-us_topic_0000001485373445_b924023315715">1.0</strong></p>
</td>
</tr>
<tr id="css_01_0194__en-us_topic_0000001485373445_row12736245506"><td class="cellrowborder" valign="top" width="29.472947294729472%" headers="mcps1.3.2.3.2.4.1.1 "><p id="css_01_0194__en-us_topic_0000001485373445_p2073924135018">flowcontrol.holding.max</p>
</td>
<td class="cellrowborder" valign="top" width="16.251625162516252%" headers="mcps1.3.2.3.2.4.1.2 "><p id="css_01_0194__en-us_topic_0000001485373445_p1173724135015">TimeValue</p>
</td>
<td class="cellrowborder" valign="top" width="54.27542754275427%" headers="mcps1.3.2.3.2.4.1.3 "><p id="css_01_0194__en-us_topic_0000001485373445_p473192435019">Maximum delay of each request. If the delay exceeds the value of this parameter, you can disconnect the request backpressure or disconnect the request link. For details, see the configuration of <span class="parmname" id="css_01_0194__en-us_topic_0000001485373445_parmname612453745515"><b>flowcontrol.holding.max_strategy</b></span>.</p>
<p id="css_01_0194__en-us_topic_0000001485373445_p1673112425012">Value range: ≥ 15s</p>
<p id="css_01_0194__en-us_topic_0000001485373445_p37319243503">Default value: <strong id="css_01_0194__en-us_topic_0000001485373445_b206971207114">60s</strong></p>
</td>
</tr>
<tr id="css_01_0194__en-us_topic_0000001485373445_row1174122416504"><td class="cellrowborder" valign="top" width="29.472947294729472%" headers="mcps1.3.2.3.2.4.1.1 "><p id="css_01_0194__en-us_topic_0000001485373445_p147372405013">flowcontrol.holding.max_strategy</p>
</td>
<td class="cellrowborder" valign="top" width="16.251625162516252%" headers="mcps1.3.2.3.2.4.1.2 "><p id="css_01_0194__en-us_topic_0000001485373445_p147472485010">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.27542754275427%" headers="mcps1.3.2.3.2.4.1.3 "><p id="css_01_0194__en-us_topic_0000001485373445_p27462414509">Policy after the maximum delay time is exceeded. The value can be:</p>
<ul id="css_01_0194__en-us_topic_0000001485373445_ul774182495016"><li id="css_01_0194__en-us_topic_0000001485373445_li13741124165015"><strong id="css_01_0194__en-us_topic_0000001485373445_b1526153914202">keep</strong> (default value): If the heap memory is still high, continue the backpressure. The server determines when to execute the request based on the real-time memory.</li><li id="css_01_0194__en-us_topic_0000001485373445_li1574112435018"><strong id="css_01_0194__en-us_topic_0000001485373445_b1861812618211">soft</strong>: The requests will be executed even if the heap memory is still high. The <strong id="css_01_0194__en-us_topic_0000001485373445_b1073715582115">inFlight</strong> circuit breaker will determine whether to execute or reject the requests.</li><li id="css_01_0194__en-us_topic_0000001485373445_li674192475015"><strong id="css_01_0194__en-us_topic_0000001485373445_b206401188226">hard</strong>: If the heap memory is still high, requests will be discarded and the client connection of the requests will be disconnected.</li></ul>
</td>
</tr>
<tr id="css_01_0194__en-us_topic_0000001485373445_row5751124115018"><td class="cellrowborder" valign="top" width="29.472947294729472%" headers="mcps1.3.2.3.2.4.1.1 "><p id="css_01_0194__en-us_topic_0000001485373445_p974102495015">flowcontrol.memory.once_free_max</p>
</td>
<td class="cellrowborder" valign="top" width="16.251625162516252%" headers="mcps1.3.2.3.2.4.1.2 "><p id="css_01_0194__en-us_topic_0000001485373445_p675112495013">String</p>
</td>
<td class="cellrowborder" valign="top" width="54.27542754275427%" headers="mcps1.3.2.3.2.4.1.3 "><p id="css_01_0194__en-us_topic_0000001485373445_p97520248502">Maximum memory that can be opened at a time for a suspended request queue. This parameter is used to prevent a cluster from being entirely suspended due to temporary low memory under high pressure.</p>
<p id="css_01_0194__en-us_topic_0000001485373445_p1775122414500">Value range: 1 to 50</p>
<p id="css_01_0194__en-us_topic_0000001485373445_p4751024145010">Default value: <strong id="css_01_0194__en-us_topic_0000001485373445_b7575124122311">10%</strong></p>
</td>
</tr>
<tr id="css_01_0194__en-us_topic_0000001485373445_row17692475019"><td class="cellrowborder" valign="top" width="29.472947294729472%" headers="mcps1.3.2.3.2.4.1.1 "><p id="css_01_0194__en-us_topic_0000001485373445_p27592417509">flowcontrol.memory.nudges_gc</p>
</td>
<td class="cellrowborder" valign="top" width="16.251625162516252%" headers="mcps1.3.2.3.2.4.1.2 "><p id="css_01_0194__en-us_topic_0000001485373445_p137512244504">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="54.27542754275427%" headers="mcps1.3.2.3.2.4.1.3 "><p id="css_01_0194__en-us_topic_0000001485373445_p1575924145015">Whether to trigger garbage collection to ensure write stability when the write pressure is too high. (The backpressure connection pool is checked every second. The write pressure is regarded high if all the existing connections are blocked and new write requests cannot be released.) The value can be:</p>
<ul id="css_01_0194__en-us_topic_0000001485373445_ul147516243503"><li id="css_01_0194__en-us_topic_0000001485373445_li1375112419506"><strong id="css_01_0194__en-us_topic_0000001485373445_b184912040132919">true</strong> (default value)</li><li id="css_01_0194__en-us_topic_0000001485373445_li137512416505"><strong id="css_01_0194__en-us_topic_0000001485373445_b4954146192915">false</strong></li></ul>
</td>
</tr>
</tbody>
</table>
</div>
<div class="note" id="css_01_0194__en-us_topic_0000001485373445_note978824125015"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="css_01_0194__en-us_topic_0000001485373445_ul108723543566"><li id="css_01_0194__en-us_topic_0000001485373445_li576125577"><span class="parmname" id="css_01_0194__en-us_topic_0000001485373445_parmname18771924574"><b>flowcontrol.memory.enabled</b></span> and <span class="parmname" id="css_01_0194__en-us_topic_0000001485373445_parmname167719235714"><b>flowcontrol.memory.heap_limit</b></span> are the most important parameters. <i><span class="varname" id="css_01_0194__en-us_topic_0000001485373445_varname278723577">enabled</span></i> indicates the memory flow control switch, and <i><span class="varname" id="css_01_0194__en-us_topic_0000001485373445_varname19781721578">heap_limit</span></i> indicates the heap memory threshold of a node.</li><li id="css_01_0194__en-us_topic_0000001485373445_li36162540573">The default value 90% of <span class="parmname" id="css_01_0194__en-us_topic_0000001485373445_parmname6618175405718"><b>flowcontrol.memory.heap_limit</b></span> is a conservative threshold. When the heap memory usage is greater than 90%, the system stops reading large requests that exceed 64 KB from the client until the heap memory decreases. If the heap memory decreases to 85%, the maximum client data that can be read is 5% of the maximum heap memory. If the heap memory usage has been higher than 90% for a long time, client connection requests cannot be read. In this case, the GC algorithm is triggered to perform garbage collection until the heap memory usage is lower than the threshold.</li><li id="css_01_0194__en-us_topic_0000001485373445_li187216549566">Generally, you can set the <span class="parmname" id="css_01_0194__en-us_topic_0000001485373445_parmname153931214125818"><b>flowcontrol.memory.heap_limit</b></span> threshold to 80% or less to ensure that the node has certain heap memory for operations besides data writing, such as Elasticsearch query and segment merge.</li></ul>
</div></div>
</div>
<div class="section" id="css_01_0194__en-us_topic_0000001485373445_section11982148192117"><h4 class="sectiontitle">Procedure</h4><ol id="css_01_0194__en-us_topic_0000001485373445_ol84271582313"><li id="css_01_0194__en-us_topic_0000001485373445_li17427681032">Log in to the CSS management console.</li><li id="css_01_0194__en-us_topic_0000001485373445_li542719818314">Choose <strong id="css_01_0194__en-us_topic_0000001485373445_b9635203314117">Clusters</strong> in the navigation pane. On the <strong id="css_01_0194__en-us_topic_0000001485373445_b1363663324114">Clusters</strong> page, locate the target cluster and click <strong id="css_01_0194__en-us_topic_0000001485373445_b17636333104118">Access Kibana</strong> in the <strong id="css_01_0194__en-us_topic_0000001485373445_b116371533134119">Operation</strong> column.</li><li id="css_01_0194__en-us_topic_0000001485373445_li194271781138">In the navigation pane on the left, choose <strong id="css_01_0194__en-us_topic_0000001485373445_b19434153511415">Dev Tools</strong> and run commands to enable or disable memory flow control.<ul id="css_01_0194__en-us_topic_0000001485373445_ul842778638"><li id="css_01_0194__en-us_topic_0000001485373445_li14271986317">Enable memory flow control<pre class="screen" id="css_01_0194__en-us_topic_0000001485373445_screen1857516140228">PUT /_cluster/settings
{
"persistent": {
"flowcontrol.memory.enabled": true,
"flowcontrol.memory.heap_limit": "80%"
}
}</pre>
</li><li id="css_01_0194__en-us_topic_0000001485373445_li680915352319">Disable cluster memory flow control<pre class="screen" id="css_01_0194__en-us_topic_0000001485373445_screen38095315235">PUT /_cluster/settings
{
"persistent": {
"flowcontrol.memory.enabled": false
}
}</pre>
</li></ul>
</li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="css_01_0191.html">Flow Control 2.0</a></div>
</div>
</div>