Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces router-side request queuing for round-robin routing, including new CLI configuration options, validation logic, and a dual-interval metrics scraping mechanism. Feedback identifies critical thread-safety concerns in both the EngineStatsScraper and RoundRobinRouter singletons. Additionally, there are concerns regarding O(N^2) performance overhead during metrics updates and the potential for premature timeouts when using a single minimum timeout value for both full and admission-only scrapes.
|
@ruizhang0101 , ready for review! |
|
@aeon-x Could you take a look at this? |
|
For getting num_requests_waiting from vllm, have you found any other solutions than scraping the full /metrics every admission interval? I am concerned that this design might not be scalable when we have to scrape many endpoints. |
Adds the supporting pieces for router-side request queueing, without enabling queueing in the request path: - router queue CLI flags and validation - round-robin admissible endpoint selection helper - admission-oriented fast refresh interval for engine stats scraping - app initialization plumbing for the admission scrape path Signed-off-by: ardecode <[email protected]>
cd871a3 to
8296ea2
Compare
Thanks for the review @aeon-x, and sorry for the slow turnaround. All four of your inline comments are addressed. On scraping the full /metrics every admission interval, you are right. The scrape is sequential and blocking, so a round costs N × (RTT + parse). Two fixes: pooled + concurrent transport, and a targeted parse instead of the full Prometheus parse. On /load it exists and returns {"server_load": N}, but its behind --enable-server-load-tracking (default False) and counts in-flight requests at the API server, not num_requests_waiting. Happy to land the two fixes here, or split them out ahead of the admission controller. |
Refs #855
Summary
This PR adds the Phase 1 groundwork for router-side request queueing.
It does not yet enable router-side request queueing in the request path. Instead, it lands the supporting pieces needed for follow-up PRs:
What is included
What is not included yet
Testing
uv run --group lint pre-commit run --all-filesuv run --group test pytest src/tests/test_parser.py -q