4 ms·
> The theoretical limit is 65k connections per IP address but the actual limit is often more like 20k, so we use multiple addresses to connect 20k to each (50 *
by supermatt 4y ago
> The theoretical limit is 65k connections per IP address but the actual limit is often more like 20k, so we use multiple addresses to connect 20k to each (50 * 20k = 1 mil).
Thats 65k per CLIENT IP address (i.e one per client IP:port pair). There should be no reason to use multiple IP addresses on the server.
If (for some reason??) you need each client to have more than 65k connections, you can add a port instead of an IP
> The client side has similar settings but does not need to set up multiple IP addresses, obviously.
You got this backwards and are now having to use a pool of server IPs to connect to instead of a single one...
- deleted 4y ago[deleted]
- punnerud 4y agoThe 65k limit is because of the port limit. WebSocket is using the “trick” of opening a port without answering before the server have any news to give, this way the messages are more push-like. How can this be fixed without more IP-addresses?
- supermatt 4y agoWhat port limit? The server is listening on a single port.
- forkerenok 4y agoEDIT: I was wrong, see child comments and the sibling comment from jacuqesm. --- Yes, it is listening on a single port, but accepted connections bind to a separate socket. Here's how it works under the hood: > The accept() call creates a new socket descriptor with the same properties as socket and returns it to the caller. [...] The new socket descriptor cannot be used to accept new connections. The original socket, socket, remains available to accept more connection requests. Pulled this from random IBM zOS docs, but it's in compliance with the Unix standard: https://www.ibm.com/docs/en/zos/2.4.0?topic=functions-accept-accept-new-connection-socket https://www.ibm.com/docs/en/zos/2.4.0?topic=functions-accept...
- tgma 4y agoSeparate socket; does not mean a separate [server] port.
- forkerenok 4y agoYes, you're right! Huge gap in understanding on my side.
- DougN7 4y agoI don’t understand - how is it not a server port? When a datagram arrives from the network it’s addressed to the server’s IP and a port (and from a client IP and port). How is the data delivered to the correct socket if not through the 5-tuple (which includes server port) to socket mapping?
- tgma 4y agoIt can be distinguished via its client IP and port.
- jacquesm 4y agoIP Backlog in answering connections all re-use the same port though. Simply put: if you had a webserver answering on port 443 then the backlog will be a number of prepared slots that all eventually will have 443 in them as the local port for the connection. You can have as many of those as you want. But only one process gets to listen to port 443 on any given IP.
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- hinkley 4y agoIt’s 65k per end, but we’re generally expecting all traffic to come in on one port for one service. To further complicate the issue, any proxies or NAT in between may reduce the number of “clients” seen. A naughty ISP may only allow you to talk to 65 k sessions at once, or per data center. And then there’s load balancers, which increase the number of ports in use if you only have one IP.