From owner-freebsd-net@FreeBSD.ORG Fri Nov 17 19:25:25 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E895616A403 for ; Fri, 17 Nov 2006 19:25:25 +0000 (UTC) (envelope-from freebsd-net@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4CA0643D46 for ; Fri, 17 Nov 2006 19:25:25 +0000 (GMT) (envelope-from freebsd-net@m.gmane.org) Received: from root by ciao.gmane.org with local (Exim 4.43) id 1Gl9Kg-0002a9-QX for freebsd-net@freebsd.org; Fri, 17 Nov 2006 20:25:03 +0100 Received: from mulderlab.f5.com ([205.229.151.151]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Nov 2006 20:25:02 +0100 Received: from atkin901 by mulderlab.f5.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Nov 2006 20:25:02 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-net@freebsd.org From: Mark Atkinson Followup-To: gmane.os.freebsd.current Date: Fri, 17 Nov 2006 11:22:09 -0800 Lines: 50 Message-ID: References: <455CB311.8040301@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: mulderlab.f5.com User-Agent: KNode/0.10.4 Sender: news Cc: freebsd-current@freebsd.org Subject: Re: Automatic TCP send socker buffer sizing X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Nov 2006 19:25:26 -0000 Andre Oppermann wrote: > 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. Did some minimal testing and it appears to apply cleanly and log: ov 17 11:15:27 ftp kernel: tcp_output: inc sockbuf, old 33304, new 41496, sb_cc 31776, snd_wnd 40544, sendwnd 20272 Nov 17 11:15:27 ftp kernel: tcp_output: inc sockbuf, old 41496, new 49688, sb_cc 38232, snd_wnd 46336, sendwnd 27512 Nov 17 11:15:27 ftp kernel: tcp_output: inc sockbuf, old 49688, new 57880, sb_cc 46960, snd_wnd 63712, sendwnd 40544 Nov 17 11:15:27 ftp kernel: tcp_output: inc sockbuf, old 57880, new 66072, sb_cc 55568, snd_wnd 63712, sendwnd 60816 Nov 17 11:15:27 ftp kernel: tcp_output: inc sockbuf, old 66072, new 74264, sb_cc 65168, snd_wnd 63712, sendwnd 63712 Nov 17 11:15:27 ftp kernel: tcp_output: inc sockbuf, old 74264, new 82456, sb_cc 65168, snd_wnd 63712, sendwnd 63712 -- Mark Atkinson atkin901@yahoo.com (!wired)?(coffee++):(wired);