Automatic TCP send socker buffer sizing



This is a patch adding automatic TCP send socket buffer sizing. Normally
the socket buffers are static (either derived from global defaults or set
with setsockopt) and do not adapt to real network conditions. Two things
happen: a) your socket buffers are too small and you can't reach the full
potential of the network between both hosts; b) your socket buffers are
too big and you waste a lot of kernel memory for data just sitting around.

With automatic TCP send socket buffers we can start with a small buffer
and quickly grow it in parallel with the TCP congestion window to match
real network conditions.

FreeBSD has a default 32K send socket buffer. This supports a maximal
transfer rate of only slightly more than 2Mbit/s on a 100ms RTT trans-
continental link. Or at 200ms just above 1Mbit/s. With TCP send buffer
auto scaling and the default values below it supports 20Mbit/s at 100ms
and 10Mbit/s at 200ms. That's an improvement of factor 10, or 1000%.

New sysctl's are:

net.inet.tcp.sndbuf_auto=1 (enabled)
net.inet.tcp.sndbuf_inc=8192 (8K, step size)
net.inet.tcp.sndbuf_max=262144 (256K, growth limit)

The patch is available here:

http://people.freebsd.org/~andre/tcp_auto_sndbuf-20061116.diff

Any testers, especially with busy FTP servers, are very welcome.

--
Andre

_______________________________________________
freebsd-net@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Automatic TCP send socker buffer sizing
    ... > This is a patch adding automatic TCP send socket buffer sizing. ... > the socket buffers are static (either derived from global defaults or set ... sb_cc 31776, snd_wnd 40544, sendwnd 20272 ...
    (freebsd-current)
  • Re: Automatic TCP send socker buffer sizing
    ... > This is a patch adding automatic TCP send socket buffer sizing. ... > the socket buffers are static (either derived from global defaults or set ... sb_cc 31776, snd_wnd 40544, sendwnd 20272 ...
    (freebsd-net)
  • Automatic TCP send socker buffer sizing
    ... This is a patch adding automatic TCP send socket buffer sizing. ... the socket buffers are static (either derived from global defaults or set ... with setsockopt) and do not adapt to real network conditions. ...
    (freebsd-current)
  • Automatic TCP send and receive socket buffer sizing
    ... This is a patch adding automatic TCP send and receive socket buffer sizing. ... Normally the socket buffers are static (either derived from global defaults ...
    (freebsd-current)
  • Automatic TCP send and receive socket buffer sizing
    ... This is a patch adding automatic TCP send and receive socket buffer sizing. ... Normally the socket buffers are static (either derived from global defaults ...
    (freebsd-net)