Genuinely curious on this—with port numbers only being 16 bits, how is it possible for one machine to ever handle more than 65k concurrent connections?
Re:Time Series and FoundationDB (2019)
by pipe_connector on Saturday May 28, 2022 @11:47AM
(#31541238)
Connections must have unique IP:Port pairs between client and server. You're limited to 65K concurrent connections for the same client. In practice, no one is opening that many connections from a single client.
Re:Time Series and FoundationDB (2019)
by dtjohnnymonkey on Saturday May 28, 2022 @12:09PM
(#31541440)
You might run into this limitation more quickly if you are receiving connections via a load balancer.
As such, the load balancer itself can probably hold a group of source IPs to use as second-hop solution to this problem as well if we're sincerely talking about load balancers holding a ton of largely idle connections simultaneously.
The more likely load balancer outcome would be DNS split on inbound client IPs, and scaling out until each load balancer handles the appropriate amount of traffic (by some measure and scale out if exceeded).
Only for L4 load balancers. L3 (switches doing ECMP) won’t modify source IP and L7 (e.g. nginx) will reuse TCP connections to the backend servers.
A connection is the tuple {source_ip, source_port, dest_ip, dest_port}
Realistically you also usually need to perform some non-trivial work from time to time for some non-trivial portion of those connections, which will further load your server, but still.
[0] https://phoenixframework.org/blog/the-road-to-2-million-webs...