-
Notifications
You must be signed in to change notification settings - Fork 686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SOLR-13350: multi-threaded search: replace cached with fixed threadpool #2508
SOLR-13350: multi-threaded search: replace cached with fixed threadpool #2508
Conversation
this.collectorExecutor = | ||
ExecutorUtil.newMDCAwareCachedThreadPool( | ||
ExecutorUtil.newMDCAwareFixedThreadPool( | ||
cfg.getIndexSearcherExecutorThreads(), // thread count | ||
cfg.getIndexSearcherExecutorThreads() * 1000, // queue size | ||
new SolrNamedThreadFactory("searcherCollector")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ThreadPoolExecutor.html documentation says "If corePoolSize or more threads are running, the Executor always prefers queuing a request rather than adding a new thread." and "If a request cannot be queued, a new thread is created unless this would exceed maximumPoolSize, in which case, the task will be rejected."
I think this means that if the queue size is generous (relative to the use of the thread pool) then queuing will always be possible and search will remain single-threaded.
Can you recommend a way to benchmark this myself, like if I wanted to tweak it to see how my ideas work out? |
I've shared the "just pass an executor" patch onto a Solr 9.5 cloud that I used, in case that's useful. The benchmarking experiments I ran used Python's |
Along with this maybe we want to change
to
|
Opened #2569 to separate that less controversial (?) change out from the less obvious (?) change here. Also there's some associated doc and config changes needed to go with making the default runtime aware. |
https://issues.apache.org/jira/browse/SOLR-13350