From owner-freebsd-net@FreeBSD.ORG Tue Nov 13 12:58:11 2012 Return-Path: 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 64920DE1 for ; Tue, 13 Nov 2012 12:58:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) by mx1.freebsd.org (Postfix) with ESMTP id 1F9938FC1A for ; Tue, 13 Nov 2012 12:58:10 +0000 (UTC) Received: from [10.0.1.109] (unknown [212.201.121.94]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id B294A1C0C069F; Tue, 13 Nov 2012 13:58:08 +0100 (CET) Subject: Re: auto tuning tcp Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=iso-8859-1 From: Michael Tuexen In-Reply-To: <50A2407A.5080909@networx.ch> Date: Tue, 13 Nov 2012 13:58:07 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <50A0A0EF.3020109@mu.org> <50A0A502.1030306@networx.ch> <50A0B8DA.9090409@mu.org> <50A0C0F4.8010706@networx.ch> <50A13961.1030909@networx.ch> <50A14460.9020504@mu.org> <50A1E2E7.3090705@mu.org> <50A1E47C.1030208@mu.org> <50A1EC92.9000507@mu.org> <50A1FF80.3040900@networx.ch> <50A20251.7010302@mu.org> <50A203F0.3020803@networx.ch> <50A207CC.3060104@mu.org> <50A2407A.5080909@networx.ch> To: Andre Oppermann X-Mailer: Apple Mail (2.1283) Cc: "freebsd-net@freebsd.org" , Alfred Perlstein X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2012 12:58:11 -0000 On Nov 13, 2012, at 1:43 PM, Andre Oppermann wrote: > On 13.11.2012 09:41, Alfred Perlstein wrote: >> On 11/13/12 12:25 AM, Andre Oppermann wrote: >>> On 13.11.2012 09:18, Alfred Perlstein wrote: >>>> On 11/13/12 12:06 AM, Andre Oppermann wrote: >>>>> On 13.11.2012 07:45, Alfred Perlstein wrote: >>>>>> If you are concerned about the space/time tradeoff I'm pretty = happy with making it 1/2, 1/4th, >>>>>> 1/8th >>>>>> the size of maxsockets. (smaller?) >>>>>>=20 >>>>>> Would that work better? >>>>>=20 >>>>> I'd go for 1/8 or even 1/16 with a lower bound of 512. More than >>>>> that is excessive. >>>>=20 >>>> I'm OK with 1/8. All I'm really going for is trying to make it = somewhat better than 512 when >>>> un-tuned. >>> > >>>>> PS: Please note that my patch for mbuf and maxfiles tuning is not = yet >>>>> in HEAD, it's still sitting in my tcp_workqueue branch. I still = have >>>>> to search for derived values that may get totally out of whack = with >>>>> the new scaling scheme. >>>>>=20 >>>> This is cool! Thank you for the feedback. >>>>=20 >>>> Would you like me to put this on a user branch somewhere for you to = merge into your perf branch? >>>=20 >>> I can put it into my branch and also merge it to HEAD with >>> a "Submitted by: alfred" line. >>>=20 >> Thank you, that works. Note: it's not even compile tested at this = point. >>=20 >> I should be able to do so tomorrow. >>=20 >> Are there other hashes to look at? I noticed a few more: >>=20 >> UDBHASHSIZE >=20 > Even busy UDP servers have only a small number of sockets open. >=20 >> netinet/tcp_hostcache.c:#define TCP_HOSTCACHE_HASHSIZE 512 >=20 > This is per host, not per connection or socket. So it should by fine > and scales independently. >=20 >> netinet/sctp_constants.h:#define SCTP_TCBHASHSIZE 1024 >> netinet/sctp_constants.h:#define SCTP_PCBHASHSIZE 256 >=20 > Michael has look at that. I can take a look... I also wanted to make it configurable... Best regards Michael >=20 >> netinet/tcp_syncache.c:#define TCP_SYNCACHE_HASHSIZE 512 >=20 > Again this is not per connection or socket. It depends on the number > of concurrent SYN's waiting on SYN/ACK-ACK for a listen socket. This > should be fine and it has overflow protection. If a SYN entry is lost > it reverts to syncookies. >=20 >> Any of these look like good targets? I think most could be looked = at. I've only glanced. I can >> provide deltas. >=20 > --=20 > Andre >=20 >=20