Re: SO_SNDBUF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yep, other OS's dont behave the same. However:

On doing a man 7 socket:

 NOTES
       Linux assumes that half of the send/receive buffer is used
       for internal kernel structures; thus the sysctls are twice
       than what can be observed on the wire.


Linux does double the buffer size:

      case SO_SNDBUF:
                        /* Don't error on this BSD doesn't and if you think
                           about it this is right. Otherwise apps have to
                           play 'guess the biggest size' games. RCVBUF/SNDBUF
                           are treated in BSD as hints */

                        if (val > sysctl_wmem_max)
                                val = sysctl_wmem_max;

                        sk->userlocks |= SOCK_SNDBUF_LOCK;
                        sk->sndbuf = max(val*2,SOCK_MIN_SNDBUF);

                        /*
                         *      Wake up sending tasks if we
                         *      upped the value.
                         */
                        sk->write_space(sk);
                        break;

Previous discussions on this topic:
http://www.uwsg.indiana.edu/hypermail/linux/kernel/0004.2/1054.html
 
While this isnt reflective of a very slow link, I see the following
on a 100Mb lan, 2.4.2 kernel, between a 400MHz and a 866Mhz uniproc:

  Actual
Socket Sizes    Message Size    Thruput   Confidence
(snd = rcv)        (bytes)       (Mb/s)   %   # iters
-----------     ------------    -------   ----------
2048            64               23.99    99  15
4096            64               30.30    99  15
8192            64               90.12    99  15
12288           64               89.90    99  15
16384           64               93.11    99  15
20480           64               92.00    99  15
24576           64               93.33    99  15
28672           64               93.33    99  15
32768           64               93.74    99  15
40960           64               93.87    99  15
49152           64               93.91    99  15
57344           64               93.92    99  15
65536           64               93.99    99  15
81920           64               92.24    99  15
98304           64               94.06    99  15
114688          64               93.46    99  15
131072          64               93.43    99  15
131072          64               93.50    99  15

  Actual
Socket Sizes    Message Size    Thruput   Confidence
(snd = rcv)        (bytes)       (Mb/s)   %   # iters
-----------     ------------    -------   ----------
2048            4096             44.23    99  15
4096            4096             57.47    99  15
8192            4096             70.29    99  15
12288           4096             91.90    99  15
16384           4096             93.81    99  15
20480           4096             92.68    99  15
24576           4096             93.68    99  15
28672           4096             93.68    99  15
32768           4096             93.76    99  15
40960           4096             94.05    99  15
49152           4096             94.00    99  15
57344           4096             93.99    99  15
65536           4096             94.02    99  15
81920           4096             93.61    99  15
98304           4096             94.08    99  15
114688          4096             93.80    99  15
131072          4096             93.76    99  15
131072          4096             93.74    99  15

  Actual
Socket Sizes    Message Size    Thruput   Confidence
(snd = rcv)        (bytes)       (Mb/s)   %   # iters
-----------     ------------    -------   ----------
2048            32768            46.64    99  15
4096            32768            59.62    99  15
8192            32768            70.82    99  15
12288           32768            91.67    99  15
16384           32768            93.85    99  15
20480           32768            92.52    99  15
24576           32768            94.04    99  15
28672           32768            94.04    99  15
32768           32768            93.93    99  15
40960           32768            94.06    99  15
49152           32768            94.07    99  15
57344           32768            94.06    99  15
65536           32768            94.08    99  15
81920           32768            93.37    99  15
98304           32768            93.69    99  15
114688          32768            93.77    99  15
131072          32768            93.88    99  15
131072          32768            93.78    99  15


thanks,
nivedita
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux