Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks
mikecote opened this issue Nov 21, 2024 · 1 comment
Open
3 tasks
Labels
Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@mikecote
Copy link
Contributor

mikecote commented Nov 21, 2024

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:

  • Maintenance windows
  • Conditional actions
  • Alert summaries

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

Definition of Done

  • Dynamically set refresh based on whether searching after writing is required
  • Performance tests confirm reduced overhead
  • Tests
@mikecote mikecote added Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels Nov 21, 2024
@elasticmachine
Copy link
Contributor

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

@mikecote mikecote changed the title Index alerts with a refresh only when necessary Optimize refresh usage when persisting alerts to reduce Elasticsearch overhead Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
None yet
Development

No branches or pull requests

2 participants