es官方为我们提供的堆内存保护机制-熔断器( breaker )
时间:2022-09-28 16:30:00
总熔断器(相当于似乎总闸)
参数: indices.breaker.total.use_real_memory
默认值:true
在 elasticsearch.yml中配置。
参数: indices.breaker.total.limit
如果 indices.breaker.total.use_real_memory : true, indices.breaker.total.limit 为堆大小的 95%。如果为false, indices.breaker.total.limit 70%的堆大小是70%
这意味着在默认情况下。当堆内存使用95%时,会报错触发熔断。
field data 熔断器
参数: indices.breaker.fielddata.limit
默认值:堆的 40%
request 熔断器
for example, memory used for calculating aggregations during a request) from exceeding a certain amount of memory.
请求用于计算的内存,例如一次agg请求,如何使用内存超过阈值,就会熔断。
indices.breaker.request.limit
默认值:堆 60%
in flight requests 熔断器
我的理解是:整个输入请求体占用的内存。
The in flight requests circuit breaker allows Elasticsearch to limit the memory usage of all currently active incoming requests on transport or HTTP level from exceeding a certain amount of memory on a node. The memory usage is based on the content length of the request itself. This circuit breaker also considers that memory is not only needed for representing the raw request but also as a structured object which is reflected by default overhead.
参数: network.breaker.inflight_requests.limit
默认值:堆 100% (受总熔断器限制)
accounting circuit breaker
限制在请求完成时未释放的内存中保存的内存的使用。这包括诸如 Lucene 段内存等内容。
参数: indices.breaker.accounting.limit
默认值:堆 100%(受总熔断器限制)
script(脚本) 熔断器
限制脚本编译的次数。
参数: script.max_compilations_rate
默认值 :150/5m 这是一个速率值,代表五分钟内 150次
正则表达式熔断器
script.painless.regex.limit-factor
参数值: 例如,输入foobarbaz
字符长度为9
。If script.painless.regex.limit-factor
is 6
,正则表达式foobarbaz
最多可以考虑 54 (9 * 6) 字符。如果表达式超过此限制,它将触发正则表达式断路器并返回错误。
参数: script.painless.regex.enabled
正则表达式熔断器是否打开?
-
limited
(默认)使用正则表达式,但使用 script.painless.regex.limit-factor 集群设置限制了复杂性。
-
true
启用无复杂性限制的正则表达式。禁用正则表达式断路器。
-
false
禁止使用正则表达式。任何包含正则表达式的表达式 Painless 脚本会回到错误。