fix(realtime): avoid false keepalive timeouts under load - #3533
Open
LauraGPT wants to merge 1 commit into
Open
Conversation
Signed-off-by: LauraGPT <170200537+LauraGPT@users.noreply.github.com>
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
ws-max-queuedoesn't fix control-frame timeoutsFixes #3528.
Root cause and controlled reproduction
Under concurrent long-audio load, synchronous VAD work and queued model decoding can delay WebSocket control-frame handling beyond 20 seconds even while a session is making valid progress. The previous
ping_interval=20,ping_timeout=20default then closed healthy connections with code 1011.On one H100 80 GB service, using the same paced 47-second Chinese WAV and 20 concurrent clients:
keepalive ping timeout)The timeout-off control proves that
ws-max-queueisn't the failure boundary: it limits incoming data messages, while ping/pong are WebSocket control frames. The exact latency varies between runs, so the pass/fail and close-code result is the relevant comparison.The reporter independently observed the same behavior on L20: 47-second/16-client sessions complete when server ping timeout and client pings are disabled. This PR's hardware result is H100 evidence, not a substitute for their L20 measurement.
Behavior and tradeoff
The default remains
ping_interval=20, so healthy connections still exchange keepalive traffic.ping_timeout=Noneprevents compute backpressure from being mistaken for a dead peer. Deployments that require server-side pong expiry can set a positive--ws-ping-timeoutafter measuring their worst-case production queue/decode delay and coordinating with gateway idle timeouts.Verification
113 passedacross realtime service, benchmark, install docs, vLLM source docs, and growth-plan testsgit diff --check