Repository navigation
fix(runner): stop the concurrent search QPS timer when the last worker finishes - #914
Merged
Merged
Conversation
…r finishes Signed-off-by: 宁烁 <zhangzongning.zzn@alibaba-inc.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Poisky The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/assign @jamesgao-jpg Could you please review this PR? |
Collaborator
|
looks good :) merged. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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 searchreported 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.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).