Maximum number of concurrent connections on a single port (socket) of Server

前端 未结 3 802
闹比i
闹比i 2020-12-01 02:54

What could be the maximum number of concurrent Clients (using different port number) that could communicate to a Server on the same port (Single socket) ? What are the facto

3条回答
  •  独厮守ぢ
    2020-12-01 03:24

    This depends in part on your operating system.

    There is however no limit on a specific port. There is a limit on the number of concurrent connections however, typically limited by the number of file descriptors the kernel supports (eg 2048).

    The thing to remember is that a TCP connection is unique and a connection is a pair of end points (local and remote IP address and port) so it doesn't matter if 1000 connections connect to the same port on a server because the connections are all still unique because the other end is different.

    The other limit to be aware of is that a machine can only make about 64K outbound connections or the kernel limit on connections, whichever is lower. That's because port is an unsigned 16 bit number (0-65535) and each outbound connection uses one of those ports.

    You can extend this by giving a machine additional IP addresses. Each IP address is another address space of 64K addresses.

提交回复
热议问题