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.
TCP vs UDPHTTP/2 vs HTTP/3Flow control vs Congestion controlSwitch vs RouterForward proxy vs Reverse proxyL4 load balancing vs L7 load balancingServer-Sent Events vs WebSocketsIPv4 vs IPv6ARP (IPv4) vs Neighbor Discovery (IPv6)Keep-alive (reuse) vs New connection per request
| Keep-alive (reuse) | New connection per request | |
|---|---|---|
| Cost per request | Just the request RTT after the first | TCP handshake (1 RTT) + TLS (1 RTT) + request, every time |
| Throughput | Congestion window stays warm; large responses stream at full speed | Every request restarts in slow start |
| Server resources | Idle sockets held open; needs an idle timeout | Sockets churn; TIME_WAIT piles up on whoever closes first |
| Failure mode | Idle-timeout race → sporadic ECONNRESET on a reused socket | Ephemeral port exhaustion under load; handshake latency dominates |
| Load balancing | L4 LBs pin a connection to one backend; distribution skews | Every request rebalances naturally |
| Default in | HTTP/1.1 and every HTTP/2 / HTTP/3 connection | HTTP/1.0, Connection: close, naive scripts |
| Choose this when | Almost 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. |