Skip to content

Commit 435a825

Browse files
authored
Default max concurrent search req. numNodes * 5 (#31171)
We moved to 1 shard by default which caused some issues in how many concurrent shard requests we allow by default. For instance searching a 5 shard index on a single node will now be executed serially per shard while we want these cases to have a good concurrency out of the box. This change moves to `numNodes * 5` which corresponds to the default we used to have in the previous version. Relates to #30783 Closes #30994
1 parent 253b998 commit 435a825

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,8 @@ private void executeSearch(SearchTask task, SearchTimeProvider timeProvider, Sea
346346
* it sane. A single search request that fans out to lots of shards should not hit a cluster too hard while 256 is already a
347347
* lot.
348348
*/
349-
searchRequest.setMaxConcurrentShardRequests(Math.min(256, nodeCount));
349+
// we use nodeCount * 5 as we used to default this to the default number of shard which used to be 5.
350+
searchRequest.setMaxConcurrentShardRequests(Math.min(256, nodeCount * 5));
350351
}
351352
boolean preFilterSearchShards = shouldPreFilterSearchShards(searchRequest, shardIterators);
352353
searchAsyncAction(task, searchRequest, shardIterators, timeProvider, connectionLookup, clusterState.version(),

0 commit comments

Comments
 (0)