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

From the socket(7) man page:

          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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.