Back to System Design Mind Map
中文·English
🏗️ System DesignID: sse-streaming-backpressure

SSE Streaming & Backpressure Control

SSE 长连接流式传输与背压控制
🎯Core Definition
Server-Sent Events (SSE) Streaming & Reactive Backpressure Architecture is the standard high-performance protocol transmitting token-by-token LLM auto-regressive completions to client browsers over persistent unidirectional streams; leveraging native HTTP/1.1 or HTTP/2 (`Content-Type: text/event-stream`), SSE is significantly more lightweight than WebSocket and features built-in browser reconnection using `Last-Event-ID`; under massive concurrency, API gateways enforce Reactive Backpressure control: if a client's network buffer saturates, the gateway signals upstream vLLM/TGI inference engines to pause token generation, preventing buffer overflow and gateway OOM crashes.
💡Use Cases
Real-time typewriter chat interfaces (ChatGPT), streaming Agent internal thoughts/reasoning logs, and live code completion.
Key Problems Solved
Blocking HTTP requests force users into 10-30 second blank-screen waits (ruining Time-To-First-Token, TTFT); SSE delivers first tokens within 200ms, while reactive backpressure protects gateway infrastructure from memory exhaustion under heavy load.
🎯5 High-Frequency Exam Points
1
Compare SSE vs WebSocket across connection overhead, bidirectional capabilities, Nginx reverse proxy buffering, and reconnection primitives?
2
Explain why configuring `proxy_buffering off;` in Nginx reverse proxies is strictly mandatory to prevent token buffering in SSE streams?
3
How do async Python generators (AsyncGenerator) in vLLM apply backpressure to pause GPU token scheduling when clients lag?
4
Design Layer-7 load balancing (Envoy / HAProxy) for long-lived SSE connections to prevent connection skew and hot-spotting?
5
How to propagate client disconnect signals via HTTP cancellation tokens to immediately abort active GPU KV-Cache generation?
Updated 2026-08-14
🎯
Test Your Knowledge: Practice Questions for "SSE Streaming & Backpressure Control"
Single choice pitfall questions with instant feedback and mistake tracking.
🚀 Start Card Practice
Previous CardMulti-Tenant Partitioning & RBACNext CardContext Budgeting & Token Management

🔗 More System Design Knowledge Cards

RecSys Multi-Stage Funnel & 50ms SLADSSM Two-Tower RetrievalYouTube DNN Candidate GenerationPre-Ranking Lightweight Architecture