加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

windows – 我可以一次打开多少个TCP套接字?

发布时间:2020-12-14 02:10:00 所属栏目:Windows 来源:网络整理
导读:参见英文答案 Increasing the maximum number of tcp/ip connections in linux????????????????????????????????????4个 我将开发一个TCP服务器应用程序.我在“选择服务器”步骤. 我的TCP服务器将拥有2000个客户端和一个套接字到每个客户端. 根据操作系统的
参见英文答案 > Increasing the maximum number of tcp/ip connections in linux????????????????????????????????????4个
我将开发一个TCP服务器应用程序.我在“选择服务器”步骤.
我的TCP服务器将拥有2000个客户端和一个套接字到每个客户端.

根据操作系统的不同,创建的套接字数量是否有限制?哪个操作系统允许在给定时间更多的开放套接字?

解决方法

是的,有一些限制,但你可能永远不会接近它们(连接与连接或接入连接不同,连接是一种非常幸福和已建立的连接,而且这个数字明显高于其他州.@ corsiKa给出了关于您可以拥有的连接会话数量的良好报价.)

以下是一些有用的命令:

# Shows some general useful information,ulimit -a

# if not,here are some other places to look
# maximum files:
cat /proc/sys/fs/file-max  

# maximum filedescriptors:
cat /proc/sys/fs/file-nr  

# maximum backlog of unaccepted clients:
cat /proc/sys/net/core/somaxconn

# And number of threads to run at once:
cat /proc/sys/kernel/threads-max

什么限制了打开You-> Them连接的数量基本上是您可以使用多少本地端口并将其指定为池,您可以在以下位置找到此信息:

sysctl net.ipv4.ip_local_port_range

在传入端口上还有一个“缓冲”限制了您可以同时连接到您的客户端数量,请在此处查找此信息:

sysctl net.ipv4.tcp_max_syn_backlog
sysctl net.core.netdev_max_backlog

另外,请在此处找到完整的说明:Increasing the maximum number of tcp/ip connections in linux

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读