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>
jamesgao-jpg added a commit to jamesgao-jpg/VectorDBBench that referenced this pull request Aug 24, 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>
XuanYang-cn pushed a commit that referenced this pull request Aug 24, 2026
* feat: add insert batch and streaming rate controls

Replace environment and CloudInsert-specific batch sizing with a task-level
insert batch size shared by CLI, REST, frontend, datasets, and runners. Keep
streaming insert rate case-specific and validate its relationship to batching.

Signed-off-by: jamesgao-jpg <james.gao@zilliz.com>

* fix(milvus): honor configured insert batch size

Signed-off-by: jamesgao-jpg <james.gao@zilliz.com>

* fix(opensearch): separate health request timeout

Signed-off-by: jamesgao-jpg <james.gao@zilliz.com>

* fix(opensearch): propagate vector metric type

Signed-off-by: jamesgao-jpg <james.gao@zilliz.com>

* fix(fts): bypass filter preparation for unfiltered loads

Signed-off-by: jamesgao-jpg <james.gao@zilliz.com>

* fix(fts): omit filter schema for unfiltered Milvus

Signed-off-by: jamesgao-jpg <james.gao@zilliz.com>

* fix(aws_opensearch): honor unified insert_batch_size for serverless bulk

Merging #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>

* fix(fts): prepare qrel-preserving capped corpus

Materialize capped qrel-preserving documents during dataset preparation and stream the prepared corpus for filtered and unfiltered loads. This keeps semantic ground truth retrievable without scanning the full raw corpus during timed insertion.

Signed-off-by: jamesgao-jpg <james.gao@zilliz.com>

* fix(frontend): allow small streaming insert rates

Lower the streaming insert rate control minimum to one and rely on the existing batch/rate validation for valid combinations.

Signed-off-by: jamesgao-jpg <james.gao@zilliz.com>

---------

Signed-off-by: jamesgao-jpg <james.gao@zilliz.com>
Co-authored-by: Ubuntu <ubuntu@ip-10-15-2-233.us-west-2.compute.internal>
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