-
Notifications
You must be signed in to change notification settings - Fork 25.2k
parallel reduce support on coordinator and parameterized #58377
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
parallel reduce support on coordinator and parameterized #58377
Conversation
QueryPhaseParallelResultConsumerCompare to PartialReduceTaskA task in thread pool with Names checkParitalReduceAggsDone()Wait all needed parallel reduces are done, then we can call SearchRequestadd |
…et(i,null) Change-Id: I056246581124f52bf33cb2f88e4c51929e8d9e21
Change-Id: I308a4925d7b94ca268860a185f79f655f9557945
Change-Id: If7830e4f01876b35c277f4d7eb5bfa53c3ed03cb
Pinging @elastic/es-analytics-geo (:Analytics/Aggregations) |
Pinging @elastic/es-search (:Search/Search) |
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.
Thanks for contributing @hackerwin7 . Although I am not sure that we want to allow parallel reduction of shard responses. The actual implementation ensures that the reduction is incremental in order to avoid cascading merges.
I am already working on a change to move the execution of the partial reduce in the search thread pool:
#58461
This change is important since it allows partial reduces to throw an exception that will cancel the search request but it doesn't allow any parallelism. We want to be able to control the memory used by partial reductions so I think it would be preferable to look at other alternatives to speed up partial merges in general. Do you have an example aggregation that is much slower when the batched reduced size is small ? In my experiments, the overhead is minimal since most of the time is spent waiting for shard responses.
@jimczi
there are five layers of aggs, and the count of buckets is extremely huge.
I agree with this. I tune the parallel patch, here is my second comparison test for this:
|
Change-Id: Iafaac6235d7c4fdb3116bfa3914ede6f3e428efe
f48fc4c
to
168d366
Compare
update parallel reduction into 2-phase execution.
|
I think if a search request parse to a lots of shard requests which the count is extremely huge (thousands of or tens thousands of), Maybe we need a parallel reduce for this case? |
Change-Id: I192ac8f45a5d9695ae47eacc6b244052cb9f4993
Change-Id: Ib619715ae27c07a64bd14f40753e3af244aeeba3
Change-Id: I7793634c17086817bcfca98d17e73f789d9218ea
I test a 1500 shards of search request with huge data set, here is comparison results:
|
Change-Id: I7639038369919afd0819a29ea167b2142e9d28c4
Change-Id: Ie21cf0cc71c1edb2157c6fea84c4f8ec780d7555
I test a benchmark for default (batch=512) mode and parallel (batch=1024,512...2) mode default
parallelbuffsize
benchmarks could find here |
Change-Id: Ice2bc1ad7a6f70e3a71ac294b981cebdad2b9e8c
There will be two mode merge styles for search request:
|
(Partial) reduction of shard responses should be a linear operation so the parallelization feels odd. I am going to close this PR because we don't want to optimize for very large aggregations. You should reduce the number of terms or levels that you return. We also made the terms reduce faster in the latest releases so you might see an improvement even when using a single thread to do the reduction. |
relates to #51857
If a search request's shard requests count is extremely huge, and batched reduce size is relatively low. the subsequent shard query result maybe block on synchronized
consumeInternal()
open this PR to discuss a way of
synchronized
removal to support a partial reduce in parallel.