Skip to content

fix(runner): stop the concurrent search QPS timer when the last worker finishes - #914

Merged
jamesgao-jpg merged 1 commit into
zilliztech:mainfrom
Poisky:codex/fix-search-qps-timing
Nov 26, 2026
Merged

jamesgao-jpg merged 1 commit into
zilliztech:mainfrom
Poisky:codex/fix-search-qps-timing

Conversation

@Poisky

@Poisky Poisky commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Summary

The concurrent search runner currently reads the end time after the parent process has collected the worker results, merged the latency lists, and calculated percentiles. In a 120-second run with 1,024 workers, End search reported 151.39 seconds. Merging the latency lists alone took about 28 seconds in a follow-up measurement.

This patch has each worker record time.perf_counter() when it leaves the query loop, before client teardown. The parent takes the latest worker timestamp as the end of the search and logs the time spent processing results separately. The timer still starts immediately after the parent releases the workers.

Benchmark

I ran both versions against the same Lindorm index with 1M Cohere vectors, using k=10, ef_search=100, reorder_factor=5, and a 120-second search duration.

Workers Successful queries (before / after) Reported duration (before / after) QPS (before / after)
512 8,464,045 / 8,463,017 135.39 s / 120.17 s 62,514 / 70,424
1,024 8,724,378 / 8,719,793 151.39 s / 120.62 s 57,628 / 72,293

At 1,024 workers, both runs completed about 8.72M queries. The patched run spent another 29.87 seconds processing results after the last worker finished. That time accounts for most of the difference in reported QPS.

Tests

Added regression tests for a request that finishes after the deadline and for workers that finish at different times. The latter simulates an extra 30 seconds of result processing and checks that QPS uses the last worker's finish time.

Ran pytest -q -m 'not integration' tests/test_mp_runner.py tests/test_milvus.py tests/test_rate_runner.py (56 passed, 1 deselected).

…r finishes

Signed-off-by: 宁烁 <zhangzongning.zzn@alibaba-inc.com>
@sre-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Poisky
To complete the pull request process, please assign jamesgao-jpg after the PR has been reviewed.
You can assign the PR to them by writing /assign @jamesgao-jpg 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

@Poisky

Poisky commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

/assign @jamesgao-jpg Could you please review this PR?

@jamesgao-jpg

Copy link
Copy Markdown
Collaborator

looks good :) merged.

@jamesgao-jpg
jamesgao-jpg merged commit 569a4d4 into zilliztech:main Nov 26, 2026
4 checks passed
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.

3 participants