[FEAT][RFC] Add router-side request queuing proposal#876
[FEAT][RFC] Add router-side request queuing proposal#876ardecode wants to merge 1 commit intovllm-project:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a formal Request for Comments (RFC) to enhance the vLLM router's resilience and traffic management capabilities. The core idea is to implement an admission control mechanism that queues incoming requests at the router level, preventing backends from becoming overwhelmed during traffic spikes. This approach aims to provide more predictable performance and clearer error signals to clients, laying the groundwork for more sophisticated routing policies in the future. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a well-written and thorough RFC for router-side request queuing. The proposal is clear, well-scoped, and considers important aspects like performance, testing, and phased implementation. My feedback includes a couple of suggestions to further clarify details around client cancellation handling for queued requests and the expected reasons for the new rejection metric, which will help ensure the implementation aligns perfectly with the design goals.
Note: Security Review has been skipped due to the limited scope of the PR.
| - Queueing is enabled only for `roundrobin` routing. | ||
| - If router queueing is enabled with any other routing mode, router startup should fail with a validation error. | ||
| - Requests that target a specific endpoint via `?id=` are not queued in V1. They are admitted only if that endpoint is below the overload threshold; otherwise they are rejected immediately with `429`. | ||
| - If queueing is disabled, existing router behavior remains unchanged. |
There was a problem hiding this comment.
The proposal mentions request cancellation in the context of releasing an endpoint lease (line 82) and in the test plan (line 171), but it's not explicitly described how cancellations are handled for requests that are waiting in the queue (i.e., before a lease is granted). For completeness, I suggest adding a bullet point to this section to clarify this behavior. This will ensure the implementation covers this important edge case.
| - Queueing is enabled only for `roundrobin` routing. | |
| - If router queueing is enabled with any other routing mode, router startup should fail with a validation error. | |
| - Requests that target a specific endpoint via `?id=` are not queued in V1. They are admitted only if that endpoint is below the overload threshold; otherwise they are rejected immediately with `429`. | |
| - If queueing is disabled, existing router behavior remains unchanged. | |
| - Queueing is enabled only for `roundrobin` routing. | |
| - If router queueing is enabled with any other routing mode, router startup should fail with a validation error. | |
| - Requests that target a specific endpoint via `?id=` are not queued in V1. They are admitted only if that endpoint is below the overload threshold; otherwise they are rejected immediately with `429`. | |
| - Queued requests that are cancelled by the client before being admitted will be removed from the queue. | |
| - If queueing is disabled, existing router behavior remains unchanged. |
| - `vllm_router:queued_requests` | ||
| - `vllm_router:queue_wait_seconds` | ||
| - `vllm_router:admissions_total` | ||
| - `vllm_router:rejections_total{reason}` |
There was a problem hiding this comment.
To make the vllm_router:rejections_total{reason} metric more concrete, it would be helpful to list the expected values for the reason label. The proposal mentions several rejection scenarios (queue full, queue timeout, pinned-endpoint overload). Explicitly listing them here would improve clarity for implementation and for users setting up monitoring.
| - `vllm_router:rejections_total{reason}` | |
| - `vllm_router:rejections_total{reason}` (e.g., reason="queue_full", "queue_timeout", "pinned_overload") |
|
@ruizhang0101 can you kindly take a look at this PR? TIA! |
ruizhang0101
left a comment
There was a problem hiding this comment.
Hi! Thanks a lot for the great proposal! From my perspective, this is very strong and solid.
Personally, I have some questions and comments regarding this RFC, hope it could be some help.
- For metrics scraper, will you use the current one or a new one? Since the current one is designed to run in a longer interval, it might need to be modified a bit to have a better performance when scraping in a faster interval.
- There is a failover mechanism which will re-route request to different endpoint, the lease might consider or be compatible with this scenario.
- It would be great to mention the concurrency control while using the lock in the admission controller or the queue wake-up design.
- I am wondering what will trigger the dequeue? Is it event-driven or is it gonna polling?
- What will happen to the queued requests while shutting down the service?
Again, nice proposal :))
|
|
I see. Could you add these to the RFC doc as well? Also, Could you also add a system diagram for this feature? And don't forget to sign-off the commit :). |
Refs #855
Summary
This PR adds an RFC for router-side request queuing in the vLLM router.
The proposal introduces router-side admission control in front of backend replicas to:
vllm:num_requests_waitingshallow429overload responsesThis PR is proposal-only.
What is included
proposals/router-side-request-queuing.mdroundrobinrouting onlysession, thenkvaware/prefixawareKey design points in the RFC
num_requests_waiting429for queue full, queue timeout, and pinned-endpoint overload?id=requests are immediate admit/reject only in Phase 1Why Phase 1 is limited to roundrobin
The RFC intentionally starts with
roundrobinsupport only so the queue core can land without simultaneously deciding:kvaware/prefixawareThose policy questions are deferred to later phases after the core queueing mechanism is validated.
-swhen doinggit commit[Bugfix],[Feat], and[CI].