-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added custom runner for setting concurrent segment search params
Signed-off-by: Martin Gaievski <[email protected]>
- Loading branch information
1 parent
b816836
commit 42ddc44
Showing
6 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
14 changes: 14 additions & 0 deletions
14
trec_covid_semantic_search/params/params_no_ml_node_concurrent_seg_search.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"bulk_indexing_clients": 4, | ||
"bulk_size": 200, | ||
"number_of_replicas": 1, | ||
"number_of_shards" :8, | ||
"ingest_percentage":100, | ||
"search_clients": 8, | ||
"warmup_iterations": 20, | ||
"iterations": 100, | ||
"variable_queries": 50, | ||
"k": 100, | ||
"only_run_on_ml_node" : "false", | ||
"concurent_segment_search_enabled": "true" | ||
} |
14 changes: 14 additions & 0 deletions
14
trec_covid_semantic_search/params/params_only_ml_node_concurrent_seg_search.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"bulk_indexing_clients": 4, | ||
"bulk_size": 200, | ||
"number_of_replicas": 1, | ||
"number_of_shards" :8, | ||
"ingest_percentage":100, | ||
"search_clients": 8, | ||
"warmup_iterations": 20, | ||
"iterations": 100, | ||
"variable_queries": 50, | ||
"k": 100, | ||
"only_run_on_ml_node" : "true", | ||
"concurent_segment_search_enabled": "true" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# The OpenSearch Contributors require contributions made to | ||
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. | ||
|
||
from osbenchmark.worker_coordinator.runner import Retry, Runner | ||
from osbenchmark.client import RequestContextHolder | ||
|
||
# This runner class and registration is a temporary workaround while the next version of OSB is pending release | ||
def register(registry): | ||
registry.register_runner( | ||
UpdateConcurrentSegmentSearchSettings.RUNNER_NAME, | ||
Retry(UpdateConcurrentSegmentSearchSettings()), async_runner=True | ||
) | ||
|
||
request_context_holder = RequestContextHolder() | ||
|
||
class UpdateConcurrentSegmentSearchSettings(Runner): | ||
|
||
RUNNER_NAME = "update-concurrent-segment-search-settings" | ||
|
||
async def __call__(self, opensearch, params): | ||
enable_setting = params.get("enable", "false") | ||
max_slice_count = params.get("max_slice_count", None) | ||
body = { | ||
"persistent": { | ||
"search.concurrent_segment_search.enabled": enable_setting | ||
} | ||
} | ||
if max_slice_count is not None: | ||
body["persistent"]["search.concurrent.max_slice_count"] = max_slice_count | ||
request_context_holder.on_client_request_start() | ||
await opensearch.cluster.put_settings(body=body) | ||
request_context_holder.on_client_request_end() | ||
|
||
def __repr__(self, *args, **kwargs): | ||
return self.RUNNER_NAME |
This file contains 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
This file contains 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