[netperf-talk] -s parameter doubt

Andrew Gallatin gallatin at cs.duke.edu
Mon Jan 25 13:40:57 PST 2010


Otavio Augusto wrote:

> Why it used the double? I set 10k but it use 20k?

The Linux kernel does this.  See the socket(7) man
page:

SOCKET(7)                  Linux Programmerâs Manual 
SOCKET(7)

NAME
        socket - Linux socket interface
<...>


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


And the same is the case for SO_SNDBUF.


Linux is the only kernel that I know of that does this, and
it provides a lot of confusion.

Drew


More information about the netperf-talk mailing list