elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.67k stars 8.23k forks source link

Optimize refresh usage when persisting alerts to reduce Elasticsearch overhead #201227

Open mikecote opened 19 hours ago

mikecote commented 19 hours ago

Description

Performance tests on the alerting framework have revealed that the current use of refresh: true during the persisting of alerts step can be resource-intensive for Elasticsearch.

An upcoming PR will set refresh: wait_for for times Kibana runs with stateful Elasticsearch. However, refresh: true is kept for times Kibana runs with stateless Elasticsearch where throttling is applied during bursts. While this mitigates some of the overhead, it introduces additional latency whenever persisting alerts.

To further optimize performance, it would be beneficial to dynamically set refresh: false when we don't need to search the data immediately after persisting it. Scenarios requiring searchable alerts after persisting include:

There may be additional scenarios not identified here. We should audit the use cases as we implement the optimization.

Definition of Done

elasticmachine commented 19 hours ago

Pinging @elastic/response-ops (Team:ResponseOps)