nginx streams your tokens fine. HAProxy holds them for 206ms.
Scored daily by a customisable AI persona to surface the most relevant engineering leadership news.
Performance comparison of nginx vs HAProxy for SSE streaming, directly actionable for cloud infrastructure.
Measurements show HAProxy 3.4.4 buffers SSE token streams for 206ms, delivering frames in bursts of five (5.12 frames per read), while nginx 1.31.5, Caddy 2.11.4, and Traefik v3.7.13 pass tokens through at 50ms intervals indistinguishable from a direct connection. The coalescing is triggered by the small payload size (~60 bytes) of LLM token streams; growing frames to ~1.1KB reduces first-token latency to 53ms and frames-per-read to 1.46, revealing the issue is a buffer-fill threshold rather than a fixed timer. The commonly advised fix for SSE buffering—nginx's proxy_buffering off—has no effect because nginx was never the problem.