From e6b078bc0f7cab3d0117f4b3f26a84bb5a5075b7 Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 09:55:12 +0200 Subject: [PATCH] [release-12.0.3] docs(alerting): performance considerations minor clarifications (#107369) docs(alerting): performance considerations minor clarifications (#107333) (cherry picked from commit f5b79fca55144f9d7e2122501a53f45855dc8b00) Co-authored-by: Pepe Cano <825430+ppcano@users.noreply.github.com> --- .../set-up/performance-limitations/index.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/sources/alerting/set-up/performance-limitations/index.md b/docs/sources/alerting/set-up/performance-limitations/index.md index 9b716efbaac..72a6515e6cc 100644 --- a/docs/sources/alerting/set-up/performance-limitations/index.md +++ b/docs/sources/alerting/set-up/performance-limitations/index.md @@ -59,18 +59,22 @@ For more information, refer to [this GitHub issue](https://github.com/grafana/gr ## High load on database caused by a high number of alert instances If you have a high number of alert instances, it can happen that the load on the database gets very high, as each state -transition of an alert instance is saved in the database. +transition of an alert instance is saved in the database after every evaluation. ### Compressed alert state -When the `alertingSaveStateCompressed` feature toggle is enabled, Grafana saves the alert rule state in a compressed form, reducing database overhead for alerts with many instances. +When the `alertingSaveStateCompressed` feature toggle is enabled, Grafana saves the alert rule state in a compressed form. Instead of performing an individual SQL update for each alert instance, Grafana performs a single SQL update per alert rule, updating all alert instances belonging to that rule. + +This can significantly reduce database overhead for alert rules with many alert instances. ### Save state periodically -High load can be also prevented by writing to the database periodically. For this the feature flag `alertingSaveStatePeriodic` needs -to be enabled. By default, it saves the states every 5 minutes to the database and on each shutdown. The periodic interval -can also be configured using the `state_periodic_save_interval` configuration flag. During this process, Grafana deletes all existing alert instances from the -database and then writes the entire current set of instances back in batches in a single transacton. +High load can be also prevented by writing to the database periodically, instead of after every evaluation. + +To save state periodically, enable the `alertingSaveStatePeriodic` feature toggle. + +By default, it saves the states every 5 minutes to the database and on each shutdown. The periodic interval +can also be configured using the `state_periodic_save_interval` configuration flag. During this process, Grafana deletes all existing alert instances from the database and then writes the entire current set of instances back in batches in a single transaction. Configure the size of each batch using the `state_periodic_save_batch_size` configuration option. The time it takes to write to the database periodically can be monitored using the `state_full_sync_duration_seconds` metric