Round-robin can distribute new WebSocket connections evenly, but it does not keep the number of live connections—or their workload—even over time. Once a server accepts an HTTP upgrade, the WebSocket stays on that backend until it closes. Different connection lifetimes and workloads can therefore leave some servers busier than others. This is a load-distribution mismatch, not a general inability to proxy WebSockets.
Why round-robin can become uneven
In NGINX HTTP load balancing, round-robin is the default when no other method is configured. It assigns successive requests across the upstream server group. NGINX describes the distribution as more or less equal when there are enough requests, the requests have uniform work, and they finish quickly. A long-lived WebSocket does not fit that short-request assumption: the initial HTTP upgrade is brief, but the resulting connection can remain open for much longer. NGINX HTTP load balancing documentation
As an Amazon Associate I earn from qualifying purchases.
That difference matters because round-robin distributes connection starts, not ongoing socket occupancy. If one connection closes quickly while another remains open, the servers’ live connection counts can diverge even if they received similar numbers of initial connections. Differences in message rates, CPU use, bandwidth, and application work can add further imbalance; the cited documentation does not quantify those effects or identify a connection count at which imbalance becomes material.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →What happens to a WebSocket after the upgrade
A WebSocket begins as an HTTP request and becomes a persistent, bidirectional connection after the server accepts the upgrade. In the Application Load Balancer case documented by AWS, the target that returns HTTP 101 handles the WebSocket connection. Frames continue over that established connection to the selected target; round-robin does not move individual frames among servers. AWS also says cookie stickiness does not apply after the upgrade. AWS Application Load Balancer target-group documentation
#1 Best Overall
Which balancing method fits the workload?
Choose a method based on what it measures and what your application needs. None of these methods can guarantee equal resource use when individual sockets do different amounts of work.
| Method | What it uses to select a backend | What to consider for WebSockets |
|---|---|---|
| Round-robin | Successive requests are distributed across servers; it is NGINX’s default when no method is set. | Distributes new connection attempts, but does not account for existing WebSocket occupancy. |
| Least-connected | NGINX sends the next request to the server with the fewest active connections. | Can help when connection count is a useful proxy for capacity, but does not account for different work per socket. |
| IP hash | Client IP address. | NGINX describes this as basic session persistence. Clients sharing an IP can concentrate on one server; affinity does not equalize resource use. |
| Ingress-NGINX cookie affinity | A cookie-based session mapping, with either balanced or persistent behavior. | Balanced mode can redistribute some sessions as a deployment scales up; persistent mode avoids rebalancing sessions to new servers and prioritizes stickiness. |
NGINX notes that with round-robin or least-connected, each subsequent client request can potentially go to a different server. That matters for separate HTTP requests that depend on application state being available on the same backend. It does not mean an established WebSocket connection is reassigned between servers. Cookie or IP affinity may help with application-level session continuity, but an already-upgraded socket is inherently tied to its selected backend while it remains open. NGINX HTTP load balancing documentation AWS Application Load Balancer target-group documentation Ingress-NGINX annotations documentation
Rank #2
Why WebSockets may close after 60 seconds
Load balancing and connection lifetime are separate concerns. Ingress-NGINX says WebSocket support is provided out of the box, but its documented defaults for proxy-read-timeout and proxy-send-timeout are both 60 seconds. The project says values higher than one hour are more adequate for WebSockets. These are ingress-nginx-specific settings, not universal defaults for all proxies or cloud load balancers. Check the deployed release and every intermediary in the network path before changing them. Ingress-NGINX miscellaneous documentation
Recommended Free Tools
If ingress-nginx is exposed through a Kubernetes LoadBalancer service, its documentation says the protocol between that load balancer and NGINX should be TCP. A timeout adjustment cannot fix a protocol or intermediary issue elsewhere along the path.
Rank #3
What to check when servers are uneven or sockets disconnect
Use observations from the whole path to distinguish connection imbalance from timeout or application problems. Track active connections per backend alongside resource use; connection counts alone can hide unequal per-socket work.
- Compare active WebSocket counts per backend with CPU, memory, and network utilization.
- Review connection lifetime distributions, upgrade success, and close reasons.
- Inspect proxy read and send timeouts at ingress and every intermediary, plus the protocol used between them.
- Check how backends are drained or terminated during deployments and scale changes.
- When testing a different balancing method, observe whether server selection uses new requests, active connection counts, IP, or cookies—and whether existing sessions are remapped as the server pool changes.
These checks follow from the connection and proxy behavior described in the documentation; the sources do not prescribe a complete monitoring checklist or provide comparative benchmark results.
Quick Recap
Rank #4
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Free tools Windows power users keep installed
One-click scans. No signup required.




