[英]backlog value in listen system call
I have a doubt regarding the backlog value in listen system call. 我对listen系统调用中的backlog值有疑问。 From man page of listen system call.
从听系统调用的手册页。
If the backlog argument is greater than the value in /proc/sys/net/core/somaxconn, then it is silently truncated to that value;
如果backlog参数大于/ proc / sys / net / core / somaxconn中的值,则会以静默方式将其截断为该值; the default value in this file is 128.
此文件中的默认值为128。
It means my server can accept only <128 connections at once. 这意味着我的服务器一次只能接受<128个连接。 What if I want to accept more connection >128 ??
如果我想接受更多连接> 128怎么办? Can I simply set the value to the possible maximum number so that I can access more number of connection ??
我可以简单地将值设置为可能的最大数量,以便我可以访问更多的连接数吗?
That number is only the size of the connection queue , where new connections wait for somebody to accept them. 该数字只是连接队列的大小,其中新连接等待某人接受它们。 As soon as your application calls
accept()
, a waiting connection is removed from that queue. 应用程序调用
accept()
,将立即从该队列中删除等待连接。 So, you can definitely handle more than 128 simultaneous connections because they usually only spend a short time in the queue. 因此,您肯定可以处理超过128个并发连接,因为它们通常只在队列中花费很短的时间。
积压值不是最大连接数,它是未完成连接的数量,即您不接受的连接():ed。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.