Вести с полей

From
Slawa Olhovchenkov (2:5030/500)
To
All
Date
2006-11-20T13:46:30Z
Area
RU.UNIX.BSD
Hello All!

From: Andre Oppermann <andre@freebsd.org>
Subject: 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.

A RELENG_6 version (for FreeBSD 6.x) of the patch is here:

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

Just apply this patch and recompile your kernel.  It is activated by default.
Be aware that all socket buffer sizing events get logged to syslog under
LOG_DEBUG.  This may affect overall system performance and you may want to
disable logging to disk of this in syslogd.conf.




... Ангелы от дьвола недалеко падают
--- GoldED+/BSD 1.1.5
 * Origin:  (2:5030/500)
SEEN-BY: 50/12 203 400/814 450/186 1024 451/30 550/196 4614/20 4635/4
SEEN-BY: 5000/5000 5011/13 5012/46 5015/28 5019/31 5020/154 175 400 545 549
SEEN-BY: 5020/758 1523 1604 1630 2142 2238 2395 2450 2590 2871 4441 5021/3 29
SEEN-BY: 5022/128 5025/3 750 5027/12 5029/32 5030/49 500 556 966 1063 1080
SEEN-BY: 5030/1900 1957 2828 5031/47 70 5035/38 5040/47 5042/13 5045/7 5049/50
SEEN-BY: 5049/97 5054/1 4 8 9 11 28 35 36 37 45 63 66 67 70 75 84 85 5055/95
SEEN-BY: 5059/9 37 5062/1 10 5063/3 5064/7 5076/1 5077/70 5080/80 1003 5082/6
SEEN-BY: 5083/21 5084/9 5085/13 5090/108 5094/4 5095/20 5096/18 5099/11
SEEN-BY: 6001/10
PATH: 5030/500 5020/4441 545 5054/1 37