Shrink searcher thread pool#74
Merged
Merged
Conversation
rdettai-sk
force-pushed
the
shrink-searcher-thread-pool
branch
2 times, most recently
from
June 30, 2026 13:09
e1ccbfc to
ce432bb
Compare
There was a problem hiding this comment.
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 - 1threads (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.
rdettai-sk
commented
Jun 30, 2026
Collaborator
Author
There was a problem hiding this comment.
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
force-pushed
the
shrink-searcher-thread-pool
branch
from
July 1, 2026 13:31
ce432bb to
4ee7b40
Compare
Darkheir
approved these changes
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.