Concurrent rule evaluation in Prometheus

Concurrent rule evaluation lets Prometheus run independent rules in a group at the same time, shortening evaluation cycles at the cost of more query load. This page covers how to enable it and tune it safely.

On this page

Why teams enable concurrent rule evaluation in Prometheus

Teams turn on concurrent rule evaluation when a large rule group finishes so late that alerts fire well after the problem began. By default, Prometheus runs rule groups concurrently with each other, but the rules inside one group run sequentially, one after another, in the order they are defined. A group with hundreds of recording and alerting rules therefore takes as long as the sum of its rule queries. The concurrent-rule-eval feature flag, enabled with --enable-feature=concurrent-rule-eval, changes that inside each group: rules that do not depend on the output of other rules in the same group are evaluated at the same time.

The trade-off is more query load. Independent rules that once waited in line now send queries in parallel, so the Prometheus server asks more of its query engine and CPU at the same moment. The global cap for independent rules is set by --rules.max-concurrent-evals, which defaults to 4, and the flag reference notes that query.max-concurrency, which defaults to 20, may need adjusting alongside it. Before enabling the flag, confirm with your own measurements how long each group takes today, which groups are actually late, and whether query capacity has headroom for parallel load. Confirm these defaults against the version you run, since flags can change between releases.

The feature is worth considering when a few large groups are the bottleneck, rule evaluation time is close to the rule interval, and the server has spare CPU and query capacity at peak. It is less useful when the groups are small, when most rules depend on each other in a chain, or when the server already saturates its query limits, because parallel evaluation will then queue behind itself. In those cases, splitting groups by dependency or reducing expensive rules usually helps more. Feature flags can also change status across releases, so check the feature flags page for your version before you plan a rollout.

Flags and settings that control concurrent evaluation

This table compares the three settings that govern concurrent rule evaluation: the feature flag, the rule evaluation limit and the query concurrency limit. Read each row as a lever: the flag turns the behavior on, the rules limit sets how many independent rules run at once, and the query limit caps the load that the server will accept overall. The main takeaway is that the two limits should be tuned together, not one at a time.

SettingWhat it controlsWhen it fitsTrade-off to weigh
--enable-feature=concurrent-rule-evalEvaluates rules without dependencies on other rules in the same group concurrently, instead of one after anotherLarge rule groups where evaluation time approaches the rule interval and most rules are independentAdds concurrent query load on the server, so the benefit depends on how much headroom the host and storage have
--rules.max-concurrent-evals (default 4)Global limit on how many independent rules can be evaluated at the same timeRaise it when the host has spare CPU and the rule groups still run late; lower it when query spikes or latency appear during evaluationHigher values shorten evaluation time but increase simultaneous queries and memory use; lower values protect other queries at the cost of slower groups
query.max-concurrency (default 20)Maximum number of queries the query engine runs at the same time, across dashboards, API calls and rulesRaise it when rules and user queries are queued behind each other; keep it bounded when the server has limited memoryToo low and rule evaluation waits on the queue; too high and the server can exhaust memory during peaks
Pairing of the two limitsDetermines whether concurrent rule work can actually reach the query engine without queuingAdjust the rules limit and the query limit together after changing the feature flag, then confirm the flag reference guidance for your versionRaising only the rules limit can shift the bottleneck into the query queue, so confirm both values in your own environment before production use
Feature flag availability by versionConfirms whether the flag is present and behaves as documented in the release line you runCheck the feature flags page for your target release before enabling it in productionBehavior can change between releases, so verify against the release you deploy rather than older documentation

How concurrent rule evaluation shares the query pool

The diagram starts at a rule group, where Prometheus separates rules that do not depend on each other from those that do. Independent rules enter a shared concurrency limit, and every query they issue draws from the same query concurrency pool before results are written back as series. Dependent rules still run one after another within the group. Check that the concurrency limit and the query pool are sized together, because the pool is where extra load shows up.

Independent rules share one concurrency limit and one query pool.

How to enable and tune concurrent rule evaluation

This sequence takes a Prometheus server from a measured baseline to a verified setting where independent rules evaluate in parallel, with query load and error rates checked at each stage.

  1. Inventory rule groups and record baseline timings

    The platform owner lists every rule file and rule group the server loads, noting the rule count per group and how many rules reference recording rules defined earlier in the same group. Then they record current evaluation duration per group and the rule evaluation failure counters from the server's own metrics, using a window long enough to cover normal load peaks. This baseline is the reference point for every later comparison. The step is done when a written table of groups, rule counts, durations and failures exists and has been reviewed by whoever owns the alerting rules.

  2. Identify rules that depend on each other

    Within each group, the engineer checks which rules read the output of a recording rule in the same group, because those rules must still run in order. Rules that query only raw series or other groups are candidates for concurrent evaluation. Sorting the groups into those with mostly independent rules and those with long dependency chains shows where the feature is likely to help and where it will not. The output is a short list of target groups, confirmed against the rule files rather than assumed from names.

  3. Enable the feature flag on a non-production instance

    The engineer turns on the concurrent-rule-eval feature flag on a staging or test Prometheus that loads the same rule files and receives comparable scrape data. They confirm in the server's startup output and configuration status page that the flag is active, and they keep the production instance unchanged. Because the feature flag increases concurrent query load, this non-production run is the place to find out what the target environment can absorb. The step is done when the test instance is running with the flag and evaluates the rule groups without new errors.

  4. Set max concurrent evals and query concurrency together

    On the test instance, the engineer sets rules.max-concurrent-evals, which caps how many independent rules evaluate at once. The default is 4, and the flag reference notes that query.max-concurrency, whose default is 20, may also need adjusting with it. Because both limits govern concurrent work against the same query engine, changing one without reviewing the other can leave queries queued or starve rule evaluation. The engineer records both values and the reason for each so the change can be reviewed and reverted cleanly.

  5. Apply the change with a reload or restart

    The platform owner applies the flags and rule configuration using the method the deployment supports. Command-line flags take effect only when the process starts, so a restart is required for them, while rule file changes can be picked up through a reload when reload endpoints are enabled and protected. The engineer confirms the running process reports the expected flag values before moving on. Restart timing should follow the team's change process, and the owner should confirm the procedure in their own environment rather than assume it.

  6. Verify evaluation timing, query latency and errors

    Once the setting is live on the test instance and then in production, the operator compares rule group evaluation duration, query latency for the dashboards and alert queries that depend on this server, and rule evaluation failure counts against the baseline from the first step. They also check CPU and memory use on the server for the same window. The step is done when evaluation durations fall for the target groups, query latency stays within the team's agreed tolerance, and no new failures or missed alert evaluations appear. If any measure worsens, the team lowers the concurrency values and repeats the check.

  7. Document the settings and set a review point

    The owner records the final flag and limit values, the rule groups affected, the baseline and post-change measurements, and the rollback steps in the team's configuration repository or runbook. They also note which Prometheus version runs the server, since feature flag behavior can change between releases, and they schedule a review after the next significant change to rule count or query load. The step is done when a colleague who was not involved can reproduce the setting and revert it from the documentation alone.

Operational risks of higher query concurrency

Raising concurrency moves more work onto the same query path that dashboards, operators and alert evaluation already share. The cards below cover the load that results, how to keep the settings reviewable, and why the admin and lifecycle endpoints should stay closed while you tune.

Load on the shared query path

Concurrent rule evaluation adds concurrent queries from rule groups, and those queries compete with ad hoc dashboards and alert evaluation for the same query capacity. Enabling the flag with --rules.max-concurrent-evals set high can make a slow dashboard panel delay an alert rule that should have fired on time. Before rollout, check rule evaluation duration and query latency on a staging server with production-like rule counts, and confirm how many concurrent queries your dashboards send at peak.

Default concurrent evals
4
Command-line flags

Coupling the two concurrency limits

The flag reference notes that query.max-concurrency, which defaults to 20, may need adjusting alongside --rules.max-concurrent-evals. Changing one without the other can leave rule evaluations queued behind user queries, or let rule load exhaust the query slots that operators depend on during an incident. Record both values together and test the pair under realistic load before changing either in production.

Flag reference

Version-controlled flag and limit settings

The feature flag, the concurrency limit and the query limit are startup arguments, so they belong in the same repository as the rest of your Prometheus configuration. Store them in the unit file, Helm values or container command that starts the server, and review changes through the same process as rule changes. Without this record, a later restart can silently drop the flag, and nobody can explain why rule timings shifted after an upgrade.

Feature flag review at each upgrade

Feature flags can change behavior between releases, so the concurrency setting needs a check at every upgrade rather than a one-time decision. Confirm the flag still exists in the target version, that its default has not changed, and that rule groups still produce the same results when evaluated concurrently. Schedule this review as part of your upgrade plan, and keep a rollback that removes the flag and restores the previous limits.

Feature flags docs

Admin API and lifecycle endpoints

The --web.enable-admin-api flag enables destructive operations, and --web.enable-lifecycle enables reload and shutdown endpoints. Both are disabled by default, and tuning concurrency does not require either. Keep them off in production, and if a reload is needed after changing these limits, restart the server through your deployment tooling so the change is recorded and the endpoints stay closed.

Security model

Exposure from higher load and open endpoints

The security model warns that some exporters take targets from URL parameters, so anyone with HTTP access can make them send requests to arbitrary endpoints. Heavier concurrent query load does not change this exposure, but it makes it harder to spot abuse in graphs. Restrict network access to the web port, put authentication and TLS in front of it, and confirm that only the intended reverse proxy can reach the lifecycle and admin paths.

Tuning choices by rule group shape and server size

Many small groups are common when rules are split by team, service or alert domain. Prometheus already runs rule groups concurrently by default, so much of the parallelism exists before any flag is set. When each group holds only a few rules, and many of those rules depend on one another, the concurrent-rule-eval feature flag has little independent work to spread out. Read the group shape before changing any limit, because the gain may be small.

  • Leave the limit at its default first: the default for rules.max-concurrent-evals is 4, and small groups seldom have enough independent rules to queue behind it.
  • Enable the flag only after measuring: the feature flags reference notes that concurrent evaluation adds query load, so test it on one group before a wider rollout.
  • Map dependency depth: rules that reference each other in a group still run in sequence, so a chain of dependent rules will not speed up.
  • Watch evaluation duration against the interval: a group whose evaluations take longer than its interval falls behind, which shows up in the rule group duration and missed iteration metrics.
  • Consolidate only with an ownership reason: merging groups changes scheduling and alert ownership, so do it for clarity, not as a performance step.

Check that each group finishes well inside its evaluation interval before and after any change.

Limits to confirm in your environment

The feature flag changes how rules run, so its behavior depends on the exact Prometheus version, the rule layout and the way the server is deployed. The cards below list the points to verify against your own release and environment before you turn it on in production.

Feature flag maturity

Confirm whether concurrent-rule-eval is still behind a feature flag in the version you run, and whether its behavior or defaults changed in the release you plan to adopt. Read the release notes for that exact version, not only the current documentation, because a flag can move from experimental to default or change its semantics between minor releases. Record the version you tested so that upgrades later can be checked against the same behavior.

Feature flags docs

Behavior across 3.x and LTS lines

Check how the flag behaves on the 3.x minor line you follow and on the long-term support line you intend to stay on. Minor releases stop receiving bug fixes after a short cycle, so a configuration tested on one minor release may need retesting after you move. Confirm whether the LTS line you choose carries the same flag behavior before you standardize on it.

Release cycle page

Recording rule dependencies

Map which rules read the output of other rules in the same group, because the flag only parallelizes rules without dependencies on each other. A recording rule that feeds an alerting rule in the same group keeps its order, so the speedup depends on your layout. Review group composition with the team that owns the rules and confirm the evaluation order still yields the results your alerts expect.

Memory and CPU headroom

Parallel evaluation raises the number of simultaneous queries against the same storage, so peak memory and CPU use can rise even when average load does not. Measure the server during a normal evaluation cycle and during the busiest period, and keep margin for incidents that trigger heavy queries. Set the concurrency limits only after you know how much spare capacity the host has.

Concurrency limit alignment

Confirm how rules.max-concurrent-evals interacts with query.max-concurrency on your server, since the rule concurrency can exhaust the query slots that dashboards and ad hoc queries also need. Test the combined limits with realistic dashboard traffic so that rule evaluation does not starve interactive users. Document both values together in your configuration review.

Remote write and agent mode

Verify how the flag applies if the server forwards samples through remote write or runs in agent mode, since agent mode does not evaluate rules or alerts locally. Confirm whether rule evaluation is even present in the deployment before you test the flag. Where rules run on a central server, check the load on the receiving storage as well, because more parallel evaluation can change write patterns downstream.

Storage docs

Questions teams ask before enabling concurrent rule evaluation

Does concurrent rule evaluation reduce alert latency?

It can, but only for rule groups where many rules are independent of each other and the group takes longer than its evaluation interval. By default, rules inside a group run one after another, so a slow rule delays every rule behind it. With --enable-feature=concurrent-rule-eval, rules without dependencies on other rules in the group run in parallel, which shortens the time a group needs to finish. Rules that depend on the output of earlier rules in the same group still run in sequence. Measure the group evaluation duration before and after the change, because a group that already finishes well inside its interval will show little gain.

What extra query load does concurrent rule evaluation add?

It adds concurrent query load on the Prometheus server and on the storage behind it. The feature flag documentation notes that running independent rules in parallel increases concurrent query load. The main cost drivers are the number of independent rules, how expensive each PromQL expression is, how many series each query touches, and how many rule groups evaluate at the same time. Check CPU, memory and query duration on the server, and watch for queries that start to queue. Test the change in a staging copy of the rule set with production-like series counts before enabling it in production.

Can our own team tune the concurrency settings?

Yes, if your team is comfortable with Prometheus flags and can read its metrics. The main setting is --rules.max-concurrent-evals, which sets the global limit for independent rules and defaults to 4. The flag reference also notes that query.max-concurrency, which defaults to 20, may need adjusting alongside it, so the two should be changed together and reviewed as a pair. Tuning is an iterative exercise: raise the limit, observe evaluation duration, query queueing and resource use, then adjust. Teams without internal capacity for that loop often hand the testing and sizing work to a partner.

How long does a rollout take, and what changes the timeline?

The duration depends mostly on how many rules and rule groups you run, how varied their query costs are, how many Prometheus servers share the change, and whether you have a staging environment that mirrors production series counts. A small rule set on one server is a short change. A large estate with several servers, dashboards that depend on rule output, and alert routing that must be re-verified takes longer. Ask any provider to break the timeline into baseline measurement, staging tests, production rollout and post-change review, and to state which of those steps depend on your change approval process.

What does a DeployOpen engagement for this change cover?

A DeployOpen engagement is fixed-scope, so scope, deliverables and timelines are agreed in writing before work starts. For this topic, that scope can cover reviewing the rule groups for dependencies, measuring baseline evaluation duration and query load, setting up a staging test, choosing values for the two concurrency flags, and documenting the result for your operators. Whether the scope also includes changes to dashboards, alert routing or remote storage depends on what you ask for. A quote follows from the written scope, and DeployOpen does not publish a price list.

What drives the cost of this work?

The cost comes from the people doing the analysis and testing, plus the infrastructure used for staging and measurement. Your own team pays in engineering hours and any extra capacity needed for test runs. A partner's quote is driven by how many rule groups and servers are in scope, how much existing rule logic must be understood before it can be parallelized, how much staging infrastructure is needed, and how much documentation and handover the work includes. The work is largely one-time, but ongoing review of the settings after each rule change or Prometheus upgrade is a recurring cost. Ask for the cost split between one-time tuning and recurring review in any quote.

Does the Prometheus project provide support for this feature?

Prometheus is open-source software licensed under Apache-2.0, and the project does not sell a paid enterprise edition of itself. Its public documentation, release notes and community channels are free to use, but they do not come with a service commitment for your environment. Support for a production deployment therefore comes from your own team, from a commercial vendor or from a service provider you contract with. Confirm the support model in writing before you rely on it, and check the release cycle page to see whether the Prometheus version you run still receives bug fixes.

How DeployOpen scopes Prometheus rule evaluation work

Concurrent rule evaluation work starts with a written scope. Before any change to --enable-feature=concurrent-rule-eval, --rules.max-concurrent-evals or query.max-concurrency, DeployOpen agrees in writing which rule groups, Prometheus servers and environments are covered, what the deliverables are and how the work will be checked. Most engagements are fixed-scope, so the reader knows the boundaries and the handover before the build begins. The scope should also state who owns the rule files, who approves a production change and which Prometheus version is in use, since the feature flag and flag defaults must be checked against the release running in the estate.

The technical work begins with a review of the existing rule groups. DeployOpen identifies which rules depend on others in the same group, because only rules without dependencies are evaluated concurrently, and checks how many independent rules each server evaluates against its query load and CPU headroom. Tuning changes are then tested in a non-production environment that mirrors the rule set and query pattern, with the extra concurrent query load measured before any value is raised. The reader should ask for the test plan, the metrics used to judge success, and a rollback step that restores the previous flags and rule file ordering if rule evaluation lags or dashboards slow down.

The final deliverable is documentation of every setting that was changed, the reasons for each value and the conditions under which it should be revisited, such as a new Prometheus version, a large addition of rules or a change in query use. Retainers cover ongoing support after the project closes, including reviews when rule groups grow and retesting after upgrades, so the tuning does not drift. The reader should confirm with DeployOpen what a retainer includes, how changes are requested and who on the reader's side receives the documentation.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.