Skip to content

Prevent search workers from starving network requests - #6759

Merged
PSeitz-dd merged 1 commit into
quickwit-oss:mainfrom
PSeitz-dd:searcher_overload
Sep 2, 2026
Merged

PSeitz-dd merged 1 commit into
quickwit-oss:mainfrom
PSeitz-dd:searcher_overload

Conversation

@PSeitz-dd

Copy link
Copy Markdown
Contributor

Summary

  • size the search Rayon pool from Quickwit's configured CPU capacity
  • prevent search work from using every CPU visible on Kubernetes nodes when QW_NUM_CPUS is lower
  • preserve CPU capacity for networking and runtime tasks such as load-reporting RPCs

Context

Kubernetes searcher pods can request fewer CPUs than their nodes expose. The Tokio runtimes respect QW_NUM_CPUS, but the Rayon search pool previously used Rayon's default available parallelism and therefore created a worker for every visible node CPU. CPU-heavy searches could saturate the node and delay load-reporting RPCs, causing healthy searchers to be treated as unreachable.

Validation

  • make fmt
  • cargo check -p quickwit-search

@PSeitz
PSeitz marked this pull request as ready for review September 2, 2026 08:21
@PSeitz
PSeitz requested a review from a team as a code owner September 2, 2026 08:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 14a1317a44

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

fn search_thread_pool() -> &'static ThreadPoolWithPriority {
static SEARCH_THREAD_POOL: LazyLock<ThreadPoolWithPriority> =
LazyLock::new(|| ThreadPoolWithPriority::new("search", None));
LazyLock::new(|| ThreadPoolWithPriority::new("search", Some(quickwit_common::num_cpus())));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Document the new QW_NUM_CPUS search-pool behavior

This makes QW_NUM_CPUS control the Rayon search-worker count, changing the operator-facing configuration contract and potentially altering search concurrency and resource sizing after an upgrade, but the commit updates no configuration or operational documentation. Document this new effect alongside the environment variable so deployments can size it with both Tokio and search workers in mind.

AGENTS.md reference: AGENTS.md:L23-L24

Useful? React with 👍 / 👎.

Size the search Rayon pool from Quickwit's configured CPU capacity instead
of all CPUs visible on the node. In Kubernetes, searcher pods can request
fewer CPUs than the node exposes, but Rayon otherwise creates a worker for
every visible CPU. CPU-heavy searches can then saturate the node and delay
load-reporting RPCs, causing searchers to be treated as unreachable.
@PSeitz-dd
PSeitz-dd enabled auto-merge (squash) September 2, 2026 09:00
@PSeitz-dd
PSeitz-dd merged commit 77548e1 into quickwit-oss:main Sep 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants