From owner-freebsd-current@FreeBSD.ORG Thu Nov 16 22:43:48 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BD44116A403 for ; Thu, 16 Nov 2006 22:43:48 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id D283243D46 for ; Thu, 16 Nov 2006 22:43:45 +0000 (GMT) (envelope-from andre@freebsd.org) Received: (qmail 38251 invoked from network); 16 Nov 2006 22:35:59 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 16 Nov 2006 22:35:59 -0000 Message-ID: <455CE9A2.6030900@freebsd.org> Date: Thu, 16 Nov 2006 23:43:46 +0100 From: Andre Oppermann User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: Andre Oppermann References: <455CB311.8040301@freebsd.org> In-Reply-To: <455CB311.8040301@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org, freebsd-current@freebsd.org Subject: Re: Automatic TCP send socker buffer sizing X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Nov 2006 22:43:48 -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 The patch was missing the changes to tcp_usrreq.c and socketvar.h. I've replaced it with an updated one. Please fetch again. -- Andre