Compare

Side-by-side on the decisions that recur: TCP vs UDP, HTTP/2 vs HTTP/3, flow vs congestion control, L4 vs L7, forward vs reverse proxy, IPv4 vs IPv6 — with when to choose each.

Keep-alive (reuse)New connection per request
Cost per requestJust the request RTT after the firstTCP handshake (1 RTT) + TLS (1 RTT) + request, every time
ThroughputCongestion window stays warm; large responses stream at full speedEvery request restarts in slow start
Server resourcesIdle sockets held open; needs an idle timeoutSockets churn; TIME_WAIT piles up on whoever closes first
Failure modeIdle-timeout race → sporadic ECONNRESET on a reused socketEphemeral port exhaustion under load; handshake latency dominates
Load balancingL4 LBs pin a connection to one backend; distribution skewsEvery request rebalances naturally
Default inHTTP/1.1 and every HTTP/2 / HTTP/3 connectionHTTP/1.0, Connection: close, naive scripts
Choose this whenAlmost always: any client that talks to the same host more than once. Set the client idle timeout below the server’s.One-shot requests to many different hosts, or when you deliberately want every request to re-balance across backends behind an L4 LB.