Server单端口(socket)最大并发连接数 [英] Maximum number of concurrent connections on a single port (socket) of Server

查看:32
本文介绍了Server单端口(socket)最大并发连接数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以在同一端口(单套接字)上与服务器通信的并发客户端(使用不同端口号)的最大数量是多少?有哪些因素会影响这个计数?我正在 Linux 环境中寻找此信息 w.r.t telnet.

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 factors that could influence this count ? I am looking for this information w.r.t telnet in Linux environment.

推荐答案

这部分取决于您的操作系统.

This depends in part on your operating system.

但是,对特定端口没有限制.然而,并发连接的数量是有限制的,通常受内核支持的文件描述符数量的限制(例如 2048).

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).

要记住的是,TCP 连接是唯一的,并且连接是一对端点(本地和远程 IP 地址和端口),因此 1000 个连接是否连接到服务器上的同一个端口并不重要,因为连接仍然是唯一的,因为另一端不同.

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.

另一个需要注意的限制是,一台机器只能进行大约 64K 的出站连接或内核对连接的限制,以较低者为准.这是因为端口是一个无符号的 16 位数字 (0-65535),每个出站连接都使用其中一个端口.

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.

您可以通过为机器提供额外的 IP 地址来扩展此功能.每个 IP 地址是另一个 64K 地址的地址空间.

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

这篇关于Server单端口(socket)最大并发连接数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆