Skip to content

Make AOSS insert batch size configurable - #843

Merged
jamesgao-jpg merged 2 commits into
zilliztech:mainfrom
norrishuang:aoss-configurable-batch-size
Aug 14, 2026
Merged

Make AOSS insert batch size configurable#843
jamesgao-jpg merged 2 commits into
zilliztech:mainfrom
norrishuang:aoss-configurable-batch-size

Conversation

@norrishuang

@norrishuang norrishuang commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Use the existing NUM_PER_BATCH configuration for OpenSearch Serverless bulk requests instead of a hard-coded batch size of 100.
  • Keep 100 as the default while allowing callers to override it through the environment.
  • Document the environment variable and add a regression test for AOSS bulk chunking.

Testing

PYTHONPATH=`pwd` python3 -m pytest -q tests/test_aws_opensearch.py
PYTHONPATH=`pwd` python3 -m black vectordb_bench
PYTHONPATH=`pwd` python3 -m ruff check vectordb_bench --fix
PYTHONPATH=`pwd` python3 -m black vectordb_bench --check
PYTHONPATH=`pwd` python3 -m ruff check vectordb_bench

Signed-off-by: norrishuang <12380647@qq.com>
@sre-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: norrishuang
To complete the pull request process, please assign xuanyang-cn after the PR has been reviewed.
You can assign the PR to them by writing /assign @xuanyang-cn in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

) -> tuple[int, Exception]:
embeddings_list = list(embeddings)
batch_size = 100 if self._is_serverless else len(embeddings_list)
batch_size = config.NUM_PER_BATCH if self._is_serverless else len(embeddings_list)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vectordb_bench/backend/clients/aws_opensearch/aws_opensearch.py line:260
Medium ---- NUM_PER_BATCH comes directly from an environment variable without a positivity check. If it is set to 0, range(..., batch_size) raises ValueError: range() arg 3 must not be zero before any request; a negative value makes the range empty and returns (0, None), falsely reporting a successful load. Please validate this setting (or clamp/reject non-positive values) before using it so operator misconfiguration cannot crash or silently skip ingestion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in fc5b23e. OpenSearch Serverless now rejects non-positive NUM_PER_BATCH values with a clear ValueError before constructing the range, and tests cover both zero and negative values.

@jamesgao-jpg

Copy link
Copy Markdown
Collaborator

Hi, thank you for the contribution! FYI we have a broader change to make num per batch a CLI variable coming in #813. Once this pr is merged, 813 will reflect upon this by controlling batch behavior through CLI.

@jamesgao-jpg

Copy link
Copy Markdown
Collaborator

/lgtm

@jamesgao-jpg
jamesgao-jpg merged commit 4ea1810 into zilliztech:main Aug 14, 2026
4 checks passed
jamesgao-jpg added a commit to jamesgao-jpg/VectorDBBench that referenced this pull request Aug 17, 2026
Merging zilliztech#843 reintroduced config.NUM_PER_BATCH, which the insert-batch-size
control feature removed. Route the AOSS serverless bulk chunk size through
the task-level insert_batch_size instead, keeping the default of 100 and
the non-positive guard.

Signed-off-by: jamesgao-jpg <james.gao@zilliz.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants