Skip to content

Shrink searcher thread pool#74

Merged
rdettai-sk merged 1 commit into
sekoiafrom
shrink-searcher-thread-pool
Jul 1, 2026
Merged

Shrink searcher thread pool#74
rdettai-sk merged 1 commit into
sekoiafrom
shrink-searcher-thread-pool

Conversation

@rdettai-sk

@rdettai-sk rdettai-sk commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Description

Reduce the searcher thread pool size by 1 by default. We have seen cases where tasks are storming the thread pool queue and the whole searcher becomes irresponsive. In deployments on big machines, leaving one CPU free is acceptable and gives the tokio runtime more room to keep things running smoothly.

Also add caller to searcher thread pool metrics.

Copilot AI review requested due to automatic review settings June 30, 2026 13:07
@rdettai-sk
rdettai-sk force-pushed the shrink-searcher-thread-pool branch 2 times, most recently from e1ccbfc to ce432bb Compare June 30, 2026 13:09

Copilot AI 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.

Pull request overview

This PR adjusts how CPU-intensive search work is scheduled and observed by (1) shrinking the default searcher Rayon thread pool size by one CPU and (2) adding a caller label to thread pool task metrics, so CPU task sources can be distinguished in observability.

Changes:

  • Configure the search thread pool to default to num_cpus - 1 threads (with an env override to use Rayon’s default sizing).
  • Add a “caller” identifier to thread pool CPU task metrics and update search code paths to pass caller IDs.
  • Refactor some CPU-task closures for readability while preserving behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
quickwit/quickwit-search/src/root.rs Adds identified caller when merging leaf search results on the search thread pool.
quickwit/quickwit-search/src/list_fields.rs Adds identified caller labels to list-fields merge CPU tasks and refactors the CPU closure.
quickwit/quickwit-search/src/lib.rs Changes search thread pool sizing defaults and logs configuration at init time.
quickwit/quickwit-search/src/leaf.rs Adds identified caller labels for several CPU-intensive leaf search tasks.
quickwit/quickwit-common/src/thread_pool.rs Introduces per-caller metrics labeling and adds a new API for identified CPU tasks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread quickwit/quickwit-search/src/lib.rs Outdated
Comment thread quickwit/quickwit-common/src/thread_pool.rs

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

lot of diff for nothing (just changed run_cpu_intensive to run_cpu_intensive_with_identified_caller)

Also add caller to searcher thread pool metrics.
@rdettai-sk
rdettai-sk force-pushed the shrink-searcher-thread-pool branch from ce432bb to 4ee7b40 Compare July 1, 2026 13:31
@rdettai-sk
rdettai-sk requested a review from Darkheir July 1, 2026 13:31
@rdettai-sk
rdettai-sk merged commit 94e0b57 into sekoia Jul 1, 2026
3 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