Disable gateway response buffering for model services - #4271
Closed
pentaoa wants to merge 1 commit into
Closed
Conversation
Contributor
|
@pentaoa we don't accept PRs if the implementation is not discussed first and the author that submits the PR is not actively using dstack. |
Author
|
@peterschmidt85 Thanks for clarifying, and apologies for not discussing the implementation with you first. I’m not currently an active dstack user, so I understand these PRs don’t meet your contribution requirements. I’ll hold off on further submissions. |
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
Fixes #4269.
proxy_bufferingproperty on services and disable it when registering a model service (both OpenAI and TGI formats).proxy_buffering off;in the named service location that forwards regular HTTP requests to replicas.This follows the issue's proposed scope. It does not change the server registration API, request buffering, WebSocket handling, or read timeouts. Disabling response buffering also applies to non-streaming requests to model services: a slow client keeps the upstream connection occupied while downloading the response instead of allowing Nginx to spool it.
Validation
Added tests that exercise service and replica registration through the gateway API and inspect the generated service location for OpenAI, TGI, and non-model services. Added startup coverage loading an old state file without the new field, checking project-scoped model association and persistence across two restarts.
Before the fix: 4 failed, 1 passed; all four model-service cases failed because the generated configuration omitted
proxy_buffering off;. The non-model control passed.After the fix:
Ruff 0.12.7 check and format checks passed for all five changed Python files;
git diff --checkpassed.These tests use the existing SSH/Nginx system mocks and execute the actual configuration renderer and state-file recovery. I did not run a real Nginx/TLS gateway or measure TTFT locally, and did not run GPU/model workloads or the full server suite.
AI-assisted implementation and tests; I reviewed the changed registration, rendering, and startup paths and ran the validation described above.