OpenSearch search backpressure and shard indexing backpressure

OpenSearch search backpressure cancels the most resource-intensive searches when a node is under duress, and shard indexing backpressure slows or rejects writes to protect shards. This page explains how each works, what to configure, and what to confirm before you rely on them.

On this page

How OpenSearch search backpressure protects nodes under load

Search backpressure and shard indexing backpressure are built-in OpenSearch protections that act on a node when it is under duress, so a few expensive operations do not slow every user of the cluster. Search backpressure cancels resource-intensive search tasks, scoring them by CPU usage, heap usage and elapsed time, and it limits how many tasks it cancels. Shard indexing backpressure applies similar pressure to write traffic arriving at individual shards. Both mechanisms are on the node side of the cluster, so they respond to what the node is actually experiencing rather than to a fixed rule written in advance.

These protections matter most when mixed workloads share one cluster. A dashboard team running wide aggregations, an application running user-facing queries and a log pipeline sending write bursts all compete for the same heap, CPU and indexing threads. Without a protection, one heavy search or a sudden write spike can push a node into memory pressure and hurt every tenant. Teams should decide which workloads are allowed to be cancelled first, which indices are latency-sensitive, and whether the cluster has enough headroom that backpressure acts as a safety net rather than a daily control. Confirm the current default thresholds and cancellation limits for your version in the OpenSearch documentation before you tune anything.

Before changing settings, read how each mechanism scores work and which metrics it exposes, then test the behavior in a non-production cluster that resembles your query mix. Backpressure will not fix a query pattern that is consistently too expensive, so plan to review cancelled requests in your logs and move heavy work to better-sized indices or scheduled jobs. The search backpressure documentation is the natural next read for the scoring model, and the shard indexing backpressure documentation covers the write side.

How a node decides between searching, cancelling and rejecting work

A search or write request enters at a coordinating node and is fanned out to data nodes that hold the relevant shards. Each data node checks its own resource state, which is measured as CPU usage, heap usage and elapsed time for search tasks, and as indexing pressure for writes. If the node is healthy, the request completes. If search resources are under duress, search backpressure scores the running tasks and cancels the most expensive ones, but only up to the configured cancellation limits. For writes, shard indexing backpressure can reject new bulk requests for a shard that is overloaded, so the client receives an error it must retry. Check which limits are configured on each node before tuning them.

Decision path for a request arriving at a data node under load.

How shard indexing backpressure handles write spikes

Shard indexing backpressure is the write-side counterpart to search backpressure. Where search backpressure cancels expensive read tasks, shard indexing backpressure slows or rejects incoming indexing requests on a shard when write load builds up, so that a burst of documents does not exhaust memory and stall the node. The aim is to keep the cluster accepting writes at a rate it can finish, rather than letting work queue until nodes degrade. Search cancellation frees resources by ending running work, while indexing backpressure applies pressure at the point where new writes enter a shard.

Teams usually notice this first from the client side. An ingest pipeline, Logstash, Fluent Bit, Data Prepper or an OpenTelemetry Collector sending bulk requests may see HTTP 429 responses, which signal that the cluster is rejecting work for now, or bulk items that fail and must be retried. Shippers with retry and buffer settings absorb short spikes, but a sustained rejection rate shows up as growing backlog, delayed log timestamps and dropped data once local buffers fill. Confirm which status codes, retry behavior and buffer limits your specific shippers apply, because the exact behavior differs between them. Plan retry and dead-letter handling in the pipeline itself, not only in the cluster.

Before you tune anything, check the shard indexing backpressure documentation for the version you run. Exact behavior, the memory thresholds that trigger throttling, the settings that control them and the way rejections are counted can change between releases, so do not copy numbers from older guides. Confirm the current settings and their defaults in your environment, and test any change under a replayed load before it reaches production.

Which backpressure settings fit each workload

Interactive search serves users who are waiting on a page, so the main risk is a small number of expensive queries (deep pagination, wildcard or regex queries, large sorts) slowing everyone else. Search backpressure is the protection that matters most here, because it can cancel the heaviest search tasks before they hold a node's CPU and heap for long. Writes are usually light relative to reads, so shard indexing backpressure is rarely the first concern.

  • Search task cancellation: Review the search backpressure settings for the CPU, heap and elapsed time thresholds and the cancellation rate limits. Confirm how aggressive these are in the version you run.
  • Cancellation limits: Check the settings that cap how many tasks can be cancelled over a period. Low caps protect user traffic less but avoid cancelling legitimate searches in bursts.
  • Query shape first: Fix unbounded queries and deep pagination in the application before loosening or tightening any threshold.
  • Client retry behavior: Confirm how the application handles a cancelled search, since a retry storm can recreate the load the protection removed.

Before changing anything, check the search backpressure documentation for your version and confirm the current setting names and default values, then test cancellation behavior under a representative query mix.

Enabling and verifying backpressure on a cluster

This sequence takes search and shard indexing backpressure from a documented setting to a measured baseline, so you know how your cluster behaves under load before any change reaches production. Each step ends with a check you can record and repeat.

  1. Confirm the version and maintenance status

    Identify the exact OpenSearch version running in the non-production cluster and check it against the OpenSearch releases page to confirm it is still under maintenance. Versions in maintenance receive bug fixes and security patches but no new features, so a version that has left maintenance may lack the settings this guide depends on. Record the version string from the cluster root endpoint, along with the version you plan to run in production. The step is done when both versions are written down and the production target is confirmed as maintained. If production is on an older version, confirm with the vendor whether backpressure behavior and settings differ before you continue.

  2. Review backpressure settings for that version

    Read the search backpressure and shard indexing backpressure pages in the OpenSearch documentation for the version you recorded, not for a different release. Note each setting name, its default, its scope (cluster or node), and whether it can be changed dynamically or requires a restart. Compare the thresholds for CPU usage, heap usage, elapsed time and cancellation limits, and record which mode each feature runs in by default. The check is a written settings inventory with the documentation link and version next to it. If a setting you expected is absent, treat that as a version difference to confirm, not a gap to fill with a guessed value.

  3. Capture the current settings as a baseline

    Before changing anything, retrieve the live cluster settings, including defaults, with the cluster settings API and store the output in version control or a change record. Do the same for the node stats output that reports search backpressure and shard indexing backpressure counters, so you have a starting point for cancellations and rejections. Your team, usually the platform or search engineering group, owns this capture. The step is complete when you can show the exact settings in effect on the non-production cluster and the counters at zero or at a known value. Without this record, you cannot tell whether a later change had any effect.

  4. Apply changes in a non-production cluster

    Change one setting group at a time in the non-production cluster, using the cluster settings API so the change is recorded and reversible. Set search backpressure and shard indexing backpressure values that match the thresholds you reviewed, and write down the previous value of each key. Keep the mode and enforcement choices explicit so the behavior is not left to a default you did not read. The check is that the API returns the new values as persistent or transient settings, as your change plan states, and that the node logs show no errors when the settings are applied. Rollback is the same API call with the previous values.

  5. Drive controlled heavy queries and writes

    Run a planned load test against the non-production cluster with a known set of expensive searches, such as deep aggregations or wide wildcard queries on a representative index, and a bulk indexing job sized to push shard indexing pressure. Ask the team that owns the workload to confirm the query shapes and data volume, because test traffic must resemble real usage to be useful. Run the load in controlled stages so you can stop it if the node becomes unstable. The step is done when the test has run to completion or been stopped deliberately, and the test parameters are recorded alongside the results. Illustrative example: a single aggregation over a large date range that a team normally runs only at night.

  6. Check node stats and logs for cancellations

    Compare the node stats counters with the baseline you captured in the earlier step, looking at search backpressure cancellations, cancellation limits reached, and shard indexing rejections. Review the OpenSearch logs on the data nodes for messages about cancelled search tasks or rejected bulk requests during the test window. A search cancelled by backpressure should appear as a failed or cancelled task, and your client code must handle that result. The step is complete when each counter change is matched to a test event, or when you have confirmed that no cancellations occurred and can explain why. Unexplained counter movement is a finding to investigate before production.

  7. Record the baseline before production rollout

    Write a baseline record that lists the OpenSearch version, the final settings with their previous values, the query and write test parameters, the observed counters and log findings, and the client-side behavior when a request was cancelled or rejected. Ask the operations owner and the application owner to review and sign off on the cancellation outcomes, since they carry the consequences of a cancelled search. Plan the production change as a separate, reviewed change that reuses the same settings and checks. The step is done when the record is approved and attached to the change ticket, and when the production rollout has a named rollback owner.

Operational risks when cancelling or rejecting work

Backpressure protects a node by dropping or refusing work, and that protection has costs. The cards below cover the risks that follow from cancelling searches and rejecting writes, and the checks that keep those trade-offs visible to the people who run the cluster.

Legitimate searches cancelled under load

Search backpressure scores tasks by CPU, heap and elapsed time, so a long but valid dashboard query or an export job can be cancelled alongside a truly runaway query. Users see failed or partial results and may retry, adding load to the same node. Before tuning, review which application teams run long searches and whether their queries can be split, cached or scheduled off-peak.

Search backpressure docs

Silent data delays from rejected writes

Shard indexing backpressure rejects bulk writes when a node is under pressure, and the sending client must handle those rejections. If the shipper, ingest pipeline or application drops rejected documents without retrying or alerting, data arrives late or never arrives, and nobody sees a failure in the cluster health view. Confirm that every producer retries rejections with backoff and that a lag metric exists for each index stream.

Shard indexing backpressure docs

Root causes masked by protection

Backpressure keeps a node alive, which can hide the reason it was under strain. An unbounded wildcard query or an oversized aggregation may be cancelled every time it runs, so the cluster looks stable while the same expensive pattern keeps returning from a scheduled report. Pair each cancellation pattern with a query review, so the fix goes to the query or the mapping and not only to the threshold.

Monitoring gaps when cancellations go unlogged

If cancelled searches and rejected writes are not recorded and counted, operators cannot tell whether protection is working or whether a team is losing data. Decide where cancellation and rejection counts are exported, who gets alerted, and how long those records are kept. Test the alert once in a non-production cluster so the first real event does not reveal a gap.

Access to expensive queries

Anyone with permission to run broad searches can push a node into backpressure, so role design is part of operational safety. Use the Security plugin's role-based access control to limit who can run cluster-wide or wildcard queries, and review which roles can reach indices that hold large volumes. Confirm the rules for impersonation and API keys, since a service account can generate the same load as a person.

Change control for tuned thresholds

Thresholds and cancellation limits change how often work is dropped, so they belong in the same change process as other cluster settings. Record the current values, the reason for each change, the owner who approved it and a rollback value. Retest after each OpenSearch upgrade, because defaults and behavior can change between releases, and confirm the release notes for your version before you adjust anything.

Questions teams ask before changing backpressure settings

Can we tune OpenSearch backpressure ourselves without a partner?

Yes, many teams can. The settings are cluster-level and the documentation describes how search backpressure scores tasks by CPU usage, heap usage and elapsed time, and how shard indexing backpressure rejects writes under pressure. The risk is not the configuration syntax but the change itself: a threshold that is too loose lets a node tip over, and one that is too tight cancels legitimate searches. Make changes in a non-production cluster first, watch the rejection and cancellation counters, and keep a written record of each value and the reason for it. If your team lacks someone who can read node statistics under load, a partner can run that review for you.

What does a partner do for backpressure work, and what does it need from us?

A partner typically reviews your current cluster settings, the query and indexing patterns that generate load, and the node metrics collected during peaks. It then proposes changes, tests them against a representative workload, and documents the result so your operators can maintain it. From your team it needs access to a staging copy or a safe test window, the cluster settings and version, sample queries and bulk request patterns, and someone who can approve changes to production. Scope, deliverables and timelines are agreed in writing before the work starts.

How long does validating backpressure settings take?

The length depends mainly on cluster size, the number of node roles involved, how varied the workload is, and how long it takes to reproduce peak load in a test environment. A small cluster with predictable traffic needs less observation time than a multi-tenant cluster whose heavy searches come from many teams. Ask any provider to break its estimate into setup, baseline measurement, test runs under load, and a final review, and to state which of those steps depends on your environment. Do not accept a duration that ignores how long you need to capture realistic peak traffic.

What drives the cost and effort of this work?

Cost follows the amount of analysis and testing, not the setting changes themselves. The main drivers are the number of clusters and environments, how many distinct workloads must be reproduced, whether you have usable metrics history, and how many people must approve changes. Some work is one-time, such as the initial baseline and the runbook. Some recurs, such as re-checking settings after major upgrades or traffic growth. When requesting a quote, ask for the work split into baseline, testing, changes and handover, and whether retesting after each OpenSearch version upgrade is included.

Does changing backpressure settings replace fixing expensive queries?

No. Backpressure protects a node by cancelling or rejecting work when it is under duress, but it does not make an expensive query cheap. Cancelled searches return errors to users and may be retried, adding load. Fixing the query itself, such as narrowing aggregations, adding filters or changing index mappings, removes the cause. Use backpressure as a safety net and use query analysis to reduce how often it triggers. Teams that only raise or lower thresholds usually see the same problems return under different traffic.

Does Apache 2.0 licensing mean we need a paid edition for these controls?

No. OpenSearch software is released under the Apache License, Version 2.0, and the OpenSearch FAQ does not describe a paid edition. Search backpressure and shard indexing backpressure are part of the open-source project, so the settings are available in your self-hosted cluster without a license purchase. Your costs come from infrastructure, staff time and any implementation or support you choose to buy. Confirm the current plugin and feature set against the OpenSearch FAQ and the release notes for your version before you plan changes.

Which OpenSearch version should we use when we change these settings?

Use a version that is still under maintenance, because maintained versions receive bug fixes and security patches. Backpressure behavior and defaults can differ between releases, so record the exact version before testing and retest after each upgrade. Check the OpenSearch releases page for the current maintenance status of your version, and confirm with your vendor or your own environment whether a setting exists in the version you run.

How DeployOpen scopes backpressure tuning work

DeployOpen scopes backpressure tuning as a fixed-scope engagement with the scope, deliverables and timeline agreed in writing before work starts. The work runs inside your own cloud accounts, data centers or air-gapped network, so the cluster, its logs and its configuration never leave your control. A written scope matters here because search backpressure and shard indexing backpressure touch several decisions at once: which search workloads are in scope, which nodes and clusters are included, and whether the work covers only settings or also query changes owned by application teams. Before a quote is issued, confirm which cluster versions and node roles are in scope and whether your team or ours will make the changes in production.

The first phase reviews the workloads that drive load. For search backpressure, that means identifying the expensive search tasks that cross the CPU, heap and elapsed time signals, and checking how often cancellations already happen in your logs and task data. For shard indexing backpressure, it means reviewing bulk indexing rates, the memory the indexing pressure limit would allow, and which indices suffer rejections during peaks. The second phase tests the protections in a non-production cluster that mirrors your production shape, using replayed or representative traffic. Testing confirms that the thresholds and cancellation limits behave as intended, and that legitimate workloads are not cancelled by mistake. Confirm with your vendor documentation which settings are dynamic and which need a restart before the test plan is written.

The final phase documents the settings and the reasons behind them for your operations team. The deliverable should list each changed setting, its previous and new value, the test evidence that supports it, the alerts or dashboards to watch, and the rollback steps. Retainers can then cover version upgrades, re-testing after traffic growth and periodic reviews of cancellation and rejection metrics, which is useful because the tuning reflects workloads that change over time. Ask any provider to state in the quote who owns the post-engagement runbook, how handover is tested and what support is included after delivery.

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.