大网数据广告活动
服务器运维问答

rx_queue value in /proc/net/udp grows to twice the SO_RCVBUF value

· 52CE 我爱测

When using an SO_RCVBUF of 10485760 (which is also the current limit as stipulated by sysctl 's net.core.rmem_max setting, and sending UDP packets faster than the receiving side is able to handle, the rx_queue column in /proc/net…

问题原文

原帖链接 · Evgeniy Berezovsky · CC BY-SA 3.0

When using an SO_RCVBUF of 10485760 (which is also the current limit as stipulated by sysctl's net.core.rmem_max setting, and sending UDP packets faster than the receiving side is able to handle, the rx_queue column in /proc/net/udp always grows to pretty much exactly twice the size of SO_RCVBUF. 20972544 was the highest value I could observe.

So is the SO_RCVBUF not being adhered to? Or is the output of /proc/net/udp wrong?

My system:

uname -a
Linux mybox 4.3.0-1-amd64 #1 SMP Debian 4.3.3-5 (2016-01-04) x86_64 GNU/Linux

已采纳解答

原帖链接 · Moises Silva · CC BY-SA 3.0

From the socket(7) man page:

   SO_RCVBUF
          Sets or gets the maximum socket receive buffer in bytes.  The
          kernel doubles this value (to allow space for bookkeeping
          overhead) when it is set using setsockopt(2), and this doubled
          value is returned by getsockopt(2).  The default value is set
          by the /proc/sys/net/core/rmem_default file, and the maximum
          allowed value is set by the /proc/sys/net/core/rmem_max file.
          The minimum (doubled) value for this option is 256.

Note that the man page indicates the kernel will double the specified buffer value for bookkeeping overhead.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-02-22)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。