-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Feat reads regional benchmark #16795
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
Draft
chandra-siri
wants to merge
6
commits into
googleapis:main
Choose a base branch
from
chandra-siri:feat-reads-regional-benchmark
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
04825ec
fix: propagate quota_project_id and api_endpoint in AsyncGrpcClient
chandra-siri b8f8828
test: update expected calls in test_async_grpc_client.py after refactor
chandra-siri 2a68c53
feat: Add reads_regional microbenchmark comparing JSON, gRPC DP, and …
chandra-siri 40b1d75
feat: Add 'whole' pattern and update config to bytes in reads_regiona…
chandra-siri c6c881e
feat: Implement num_downloads_after_open and ignore_first_download in…
chandra-siri cc25b46
feat: Add explicit Range header for 'whole' pattern in JSON read
chandra-siri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
105 changes: 105 additions & 0 deletions
105
packages/google-cloud-storage/tests/perf/microbenchmarks/time_based/reads_regional/config.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| # Copyright 2026 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| import itertools | ||
| import os | ||
| from typing import Dict, List | ||
|
|
||
| import yaml | ||
|
|
||
| try: | ||
| from tests.perf.microbenchmarks.time_based.reads_regional.parameters import ( | ||
| TimeBasedReadParameters, | ||
| ) | ||
| except ModuleNotFoundError: | ||
| from reads_regional.parameters import TimeBasedReadParameters | ||
|
|
||
|
|
||
| def _get_params() -> Dict[str, List[TimeBasedReadParameters]]: | ||
| """Generates a dictionary of benchmark parameters for time based read operations.""" | ||
| params: Dict[str, List[TimeBasedReadParameters]] = {} | ||
| config_path = os.path.join(os.path.dirname(__file__), "config.yaml") | ||
| with open(config_path, "r") as f: | ||
| config = yaml.safe_load(f) | ||
|
|
||
| common_params = config["common"] | ||
| read_types = common_params["read_types"] | ||
| file_sizes = common_params["file_sizes"] | ||
| chunk_sizes_kib = common_params["chunk_sizes_kib"] | ||
| num_ranges = common_params["num_ranges"] | ||
| rounds = common_params["rounds"] | ||
| duration = common_params["duration"] | ||
| warmup_duration = common_params["warmup_duration"] | ||
| num_downloads_after_open = common_params["num_downloads_after_open"] | ||
| ignore_first_download = common_params["ignore_first_download"] | ||
|
|
||
| # All read types use the same regional bucket | ||
| bucket_name = os.environ.get( | ||
| "DEFAULT_STANDARD_BUCKET", config["defaults"]["DEFAULT_STANDARD_BUCKET"] | ||
| ) | ||
|
|
||
| for workload in config["workload"]: | ||
| workload_name = workload["name"] | ||
| params[workload_name] = [] | ||
| pattern = workload["pattern"] | ||
| processes = workload["processes"] | ||
| coros = workload["coros"] | ||
|
|
||
| # Create a product of all parameter combinations | ||
| product = itertools.product( | ||
| read_types, | ||
| file_sizes, | ||
| chunk_sizes_kib, | ||
| num_ranges, | ||
| processes, | ||
| coros, | ||
| ) | ||
|
|
||
| for ( | ||
| read_type, | ||
| file_size, | ||
| chunk_size_kib, | ||
| num_ranges_val, | ||
| num_processes, | ||
| num_coros, | ||
| ) in product: | ||
| file_size_bytes = file_size | ||
| chunk_size_bytes = chunk_size_kib * 1024 | ||
|
|
||
| num_files = num_processes | ||
|
|
||
| # Create a descriptive name for the parameter set | ||
| name = f"{pattern}_{read_type}_{num_processes}p_{num_coros}c_{file_size / (1024 * 1024)}MiB_{chunk_size_kib}KiB_{num_ranges_val}ranges" | ||
|
|
||
| params[workload_name].append( | ||
| TimeBasedReadParameters( | ||
| name=name, | ||
| workload_name=workload_name, | ||
| pattern=pattern, | ||
| bucket_name=bucket_name, | ||
| bucket_type="regional", | ||
| read_type=read_type, | ||
| num_coros=num_coros, | ||
| num_processes=num_processes, | ||
| num_files=num_files, | ||
| rounds=rounds, | ||
| chunk_size_bytes=chunk_size_bytes, | ||
| file_size_bytes=file_size_bytes, | ||
| duration=duration, | ||
| warmup_duration=warmup_duration, | ||
| num_ranges=num_ranges_val, | ||
| num_downloads_after_open=num_downloads_after_open, | ||
| ignore_first_download=ignore_first_download, | ||
| ) | ||
| ) | ||
| return params | ||
34 changes: 34 additions & 0 deletions
34
...ges/google-cloud-storage/tests/perf/microbenchmarks/time_based/reads_regional/config.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| common: | ||
| read_types: | ||
| - "async_json" | ||
| - "async_grpc_dp" | ||
| - "async_grpc_cp" | ||
| file_sizes: | ||
| - 10737418240 # 10GiB in bytes | ||
| chunk_sizes_kib: [64] | ||
| num_ranges: [1] | ||
| rounds: 1 | ||
| num_downloads_after_open: 3 | ||
| ignore_first_download: true | ||
| duration: 30 # seconds | ||
| warmup_duration: 5 # seconds | ||
|
|
||
| workload: | ||
| ############# multi process multi coroutine ######### | ||
| - name: "read_seq_multi_process" | ||
| pattern: "seq" | ||
| coros: [1] | ||
| processes: [96] | ||
|
|
||
| - name: "read_rand_multi_process" | ||
| pattern: "rand" | ||
| coros: [1, 16] | ||
| processes: [1] | ||
|
|
||
| - name: "read_whole_multi_process" | ||
| pattern: "whole" | ||
| coros: [1] | ||
| processes: [1] | ||
|
|
||
| defaults: | ||
| DEFAULT_STANDARD_BUCKET: "chandrasiri-benchmarks-rb" |
27 changes: 27 additions & 0 deletions
27
...s/google-cloud-storage/tests/perf/microbenchmarks/time_based/reads_regional/parameters.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Copyright 2026 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| from dataclasses import dataclass | ||
|
|
||
| from tests.perf.microbenchmarks.parameters import IOBenchmarkParameters | ||
|
|
||
|
|
||
| @dataclass | ||
| class TimeBasedReadParameters(IOBenchmarkParameters): | ||
| pattern: str | ||
| duration: int | ||
| warmup_duration: int | ||
| num_ranges: int | ||
| read_type: str | ||
| num_downloads_after_open: int | ||
| ignore_first_download: bool |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
It is recommended to specify an explicit encoding (e.g.,
encoding="utf-8") when opening files to ensure consistent behavior across different platforms and locales.