服务器的单个端口(套接字)上的并发连接的最大数量 [英] Maximum number of concurrent connections on a single port (socket) of Server

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

问题描述

什么是可以在同一端口(单套接字)上与服务器通信的并发客户端的最大数量(使用不同的端口号)?什么是可能影响这个数字的因素?我在Linux环境中寻找这个信息wrt telnet。

解决方案

这部分取决于你的操作系统。

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



TCP连接是唯一的,并且连接是一对端点(本地和远程IP地址和端口),所以如果1000个连接连接到服务器上的同一端口没有关系,因为连接都仍然是唯一的,因为另一端是不同的。



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



你可以通过给机器额外的IP地址。每个IP地址是64K地址的另一个地址空间。


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.

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.

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

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