From 8ec1c15b94cf6a92cb7aa2a521f7e8b5c2e53627 Mon Sep 17 00:00:00 2001 From: Drew Miranda <107503402+drewmiranda-gl@users.noreply.github.com> Date: Wed, 13 Mar 2024 14:27:56 -0400 Subject: [PATCH] Fix ambiguity with settings for search_backpressure (#6655) * Fix ambiguity with settings for search_backpressure This page is lacking in clearly stating how to enable/configure search_backpressure. While it may be domain knowledge that cluster settings always use `_cluster/settings`, many people that administrate or use OpenSearch are not full time OpenSearch admins and this info is very easy to document. Signed-off-by: Drew Miranda <107503402+drewmiranda-gl@users.noreply.github.com> * Update _tuning-your-cluster/availability-and-recovery/search-backpressure.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: Drew Miranda <107503402+drewmiranda-gl@users.noreply.github.com> * Update _tuning-your-cluster/availability-and-recovery/search-backpressure.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: Drew Miranda <107503402+drewmiranda-gl@users.noreply.github.com> * Update _tuning-your-cluster/availability-and-recovery/search-backpressure.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: Drew Miranda <107503402+drewmiranda-gl@users.noreply.github.com> * Update _tuning-your-cluster/availability-and-recovery/search-backpressure.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: Drew Miranda <107503402+drewmiranda-gl@users.noreply.github.com> * Update _tuning-your-cluster/availability-and-recovery/search-backpressure.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: Drew Miranda <107503402+drewmiranda-gl@users.noreply.github.com> * Update _tuning-your-cluster/availability-and-recovery/search-backpressure.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: Drew Miranda <107503402+drewmiranda-gl@users.noreply.github.com> * Update _tuning-your-cluster/availability-and-recovery/search-backpressure.md Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Update search-backpressure.md fix formatting Signed-off-by: Drew Miranda <107503402+drewmiranda-gl@users.noreply.github.com> --------- Signed-off-by: Drew Miranda <107503402+drewmiranda-gl@users.noreply.github.com> Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> --- .../search-backpressure.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/_tuning-your-cluster/availability-and-recovery/search-backpressure.md b/_tuning-your-cluster/availability-and-recovery/search-backpressure.md index affcd8df..58c0d298 100644 --- a/_tuning-your-cluster/availability-and-recovery/search-backpressure.md +++ b/_tuning-your-cluster/availability-and-recovery/search-backpressure.md @@ -10,7 +10,7 @@ redirect_from: # Search backpressure -Search backpressure is a mechanism used to identify resource-intensive search requests and cancel them when the node is under duress. If a search request on a node or shard has breached the resource limits and does not recover within a certain threshold, it is rejected. These thresholds are dynamic and configurable through [cluster settings](#search-backpressure-settings). +Search backpressure is a mechanism used to identify resource-intensive search requests and cancel them when the node is under duress. If a search request on a node or shard has breached the resource limits and does not recover within a certain threshold, it is rejected. These thresholds are dynamic and configurable through [cluster settings](#search-backpressure-settings) using the `/_cluster/settings` API endpoint. ## Measuring resource consumption @@ -78,6 +78,20 @@ Search backpressure runs in `monitor_only` (default), `enforced`, or `disabled` Search backpressure adds several settings to the standard OpenSearch cluster settings. These settings are dynamic, so you can change the default behavior of this feature without restarting your cluster. +To configure these settings, send a PUT request to `/_cluster/settings`: + +```json +PUT /_cluster/settings +{ + "persistent": { + "search_backpressure": { + "mode": "monitor_only" + } + } +} +``` +{% include copy-curl.html %} + Setting | Default | Description :--- | :--- | :--- search_backpressure.mode | `monitor_only` | The search backpressure [mode](#search-backpressure-modes). Valid values are `monitor_only`, `enforced`, or `disabled`. @@ -259,4 +273,4 @@ The `cancellation_stats` object contains the following statistics for the tasks Field Name | Data type | Description :--- | :--- | :--- cancellation_count | Integer | The total number of tasks marked for cancellation since the node last restarted. -cancellation_limit_reached_count | Integer | The number of times when the number of tasks eligible for cancellation exceeded the set cancellation threshold. \ No newline at end of file +cancellation_limit_reached_count | Integer | The number of times when the number of tasks eligible for cancellation exceeded the set cancellation threshold.