From owner-freebsd-net@FreeBSD.ORG Wed Nov 22 06:36:59 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D0C1016A416 for ; Wed, 22 Nov 2006 06:36:59 +0000 (UTC) (envelope-from chrcoluk@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.178]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA63943D4C for ; Wed, 22 Nov 2006 06:36:31 +0000 (GMT) (envelope-from chrcoluk@gmail.com) Received: by py-out-1112.google.com with SMTP id f31so36138pyh for ; Tue, 21 Nov 2006 22:36:57 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=dk24O3vpItNsxmdZAnNJ2OTj161PN4rblRKLpcIjXwba6Y7rALUNtqGklRLIec3Rq/6bnfwQxXJCXP90ew/+j/+VOcCxsk4U9FdmQ+MpChoC9PhdZ5pJ1Td1p8UwwZJjQ3W0Ht82Z+D7Av2iaZm3+g2gMWzLP+FkbwG1QdDAkjo= Received: by 10.35.70.17 with SMTP id x17mr343816pyk.1164177417600; Tue, 21 Nov 2006 22:36:57 -0800 (PST) Received: by 10.35.29.20 with HTTP; Tue, 21 Nov 2006 22:36:57 -0800 (PST) Message-ID: <3aaaa3a0611212236j1e4c48dbo30355a830cb12fed@mail.gmail.com> Date: Wed, 22 Nov 2006 06:36:57 +0000 From: Chris To: "Andre Oppermann" In-Reply-To: <455CB311.8040301@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <455CB311.8040301@freebsd.org> Cc: freebsd-net@freebsd.org, 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: Wed, 22 Nov 2006 06:37:00 -0000 On 16/11/06, 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. > > -- > Andre > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > Ok I done some intitial tesing and so far looks sweet. I set default send window to 32120 and started a fxp transfer to another which on 64240 was limited to around 40mbit so 32120 would normally give about 20mbit, and I previously had 128280 for 80mbit, now with a default of 32120 and your default sndbuf settings it zoomed along at around 80mbit. this from debug.log shows it working. Nov 22 06:33:33 heaven kernel: tcp_output: inc sockbuf, old 82456, new 90648, sb_cc 80272, snd_wnd 66984, sendwnd 66608 Nov 22 06:33:33 heaven kernel: tcp_output: inc sockbuf, old 90648, new 98840, sb_cc 89664, snd_wnd 72776, sendwnd 69504 Nov 22 06:33:33 heaven kernel: tcp_output: inc sockbuf, old 98840, new 107032, sb_cc 97608, snd_wnd 81464, sendwnd 73848 Nov 22 06:33:33 heaven kernel: tcp_output: inc sockbuf, old 107032, new 115224, sb_cc 107000, snd_wnd 87256, sendwnd 76744 Nov 22 06:33:33 heaven kernel: tcp_output: inc sockbuf, old 115224, new 123416, sb_cc 112296, snd_wnd 93048, sendwnd 79640 Nov 22 06:33:33 heaven kernel: tcp_output: inc sockbuf, old 123416, new 131608, sb_cc 121688, snd_wnd 98840, sendwnd 82536 Nov 22 06:33:33 heaven kernel: tcp_output: inc sockbuf, old 131608, new 139800, sb_cc 129632, snd_wnd 107528, sendwnd 86880 Nov 22 06:33:34 heaven kernel: tcp_output: inc sockbuf, old 139800, new 147992, sb_cc 137992, snd_wnd 112944, sendwnd 110048 Nov 22 06:33:34 heaven kernel: tcp_output: inc sockbuf, old 147992, new 156184, sb_cc 147384, snd_wnd 118736, sendwnd 112944 Nov 22 06:33:34 heaven kernel: tcp_output: inc sockbuf, old 156184, new 164376, sb_cc 155328, snd_wnd 127424, sendwnd 114261 cant wait for the recv side of this patch. Chris