freebsd-dev/sys
Andre Oppermann 6741ecf595 Auto sizing TCP socket buffers.
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 and receive 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%. For the receive side it looks slightly better with a default of
64K buffer size.

New sysctls are:
  net.inet.tcp.sendbuf_auto=1 (enabled)
  net.inet.tcp.sendbuf_inc=8192 (8K, step size)
  net.inet.tcp.sendbuf_max=262144 (256K, growth limit)
  net.inet.tcp.recvbuf_auto=1 (enabled)
  net.inet.tcp.recvbuf_inc=16384 (16K, step size)
  net.inet.tcp.recvbuf_max=262144 (256K, growth limit)

Tested by:	many (on HEAD and RELENG_6)
Approved by:	re
MFC after:	1 month
2007-02-01 18:32:13 +00:00
..
amd64 Introduce some more SO_ option equivalents from Linux to FreeBSD. 2007-02-01 13:36:19 +00:00
arm Use our own timer that piggybacks on npe_tick() callout instead of 2007-01-30 01:18:29 +00:00
boot
bsm
cam Use the more specific 'EM732X' designation rather than * to disable sync 2007-01-23 17:29:31 +00:00
coda
compat Introduce some more SO_ option equivalents from Linux to FreeBSD. 2007-02-01 13:36:19 +00:00
conf Remove MSDOSFS_LARGE compile time option. It has been converted 2007-01-30 05:01:06 +00:00
contrib
crypto
ddb
dev Fix huge memory leak within sound buffer (during channel destruction, 2007-02-01 09:46:03 +00:00
fs Fixing compilation bustage by removing references to opt_msdosfs.h. 2007-01-30 08:05:04 +00:00
gdb
geom We expect 'bio_data != NULL' for BIO_{READ,WRITE,GETATTR}, but for 2007-01-28 23:36:07 +00:00
gnu Cylinder group bitmaps and blocks containing inode for a snapshot 2007-01-23 10:01:19 +00:00
i4b
i386 Introduce some more SO_ option equivalents from Linux to FreeBSD. 2007-02-01 13:36:19 +00:00
ia64
isa Cleaned up declaration and initialization of clock_lock. It is only 2007-01-23 08:01:20 +00:00
isofs/cd9660
kern Generic socket buffer auto sizing support, header defines, flag inheritance. 2007-02-01 17:53:41 +00:00
libkern
modules Reflecting the removal of MSDOSFS_LARGE found in sys/conf/files:1.1173. 2007-02-01 04:21:03 +00:00
net Update comment for struct bpf_d: we now store buffered packets for BPF 2007-01-29 14:41:03 +00:00
net80211
netatalk
netatm
netgraph - Create ng_ppp_bypass() function, that prepares a packet 2007-01-25 21:16:50 +00:00
netinet Auto sizing TCP socket buffers. 2007-02-01 18:32:13 +00:00
netinet6 Revert nd6.c revs. 1.67, 1.68, 1.69, 1.70 in an attempt to unbreak 2007-01-26 23:22:58 +00:00
netipsec
netipx
netkey
netnatm
netncp
netsmb
nfs
nfs4client Rename some functions and variables from nfs_* to nfs4_* to avoid 2007-01-25 14:33:13 +00:00
nfsclient Fix for a vnode lock leak in nfs_create() in the event of an error. 2007-01-31 23:10:27 +00:00
nfsserver
opencrypto
pc98 MFi386: revision 1.647. 2007-01-28 07:19:14 +00:00
pccard
pci Change the remainder of the drivers for DMA'ing devices enabled in the 2007-01-21 19:32:51 +00:00
powerpc Remove stale header. 2007-01-26 04:58:31 +00:00
rpc
security
sparc64
sun4v MFsparc64: Add .cvsignore file here too. 2007-01-30 10:50:55 +00:00
sys Generic socket buffer auto sizing support, header defines, flag inheritance. 2007-02-01 17:53:41 +00:00
tools
ufs Prevent quotactl calls that pass in an id of -1 from incorrectly 2007-02-01 02:13:53 +00:00
vm Fix for problems that occur when all mbuf clusters migrate to the mbuf packet 2007-01-25 01:05:23 +00:00
Makefile