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

前端 未结 3 804
闹比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:40

    More than you care about. Or rather.

    • More than your code can actually handle (for other reasons)
    • More than your clients will actually make
    • More than you can handle on a single box for performance reasons
    • More than you need on a single box because your load balancers will distribute them amongst several for availability reasons anyway

    I can guarantee that it is more than all of those. There are scalability limitations with large numbers of sockets, which can be worked around (Google for the c10k problem). In practice it is possible to have more than 10,000 sockets usefully used by a single process under Linux. If you have multiple processes per server, you can increase that up again.

    It is not necessary to use a single port, as your dedicated load-balancers will be able to round-robin several ports if needed.

    If you are running a service for many 10s of 1000s of client processes, it is probably fairly important that it keeps working, therefore you will need several servers for redunancy ANYWAY. Therefore you won't have a problem deploying a few more servers.

提交回复
热议问题