From owner-freebsd-current@FreeBSD.ORG Tue Sep 14 11:00:52 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C41081065673 for ; Tue, 14 Sep 2010 11:00:52 +0000 (UTC) (envelope-from mdounin@mdounin.ru) Received: from mdounin.cust.ramtel.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mx1.freebsd.org (Postfix) with ESMTP id 8123E8FC17 for ; Tue, 14 Sep 2010 11:00:52 +0000 (UTC) Received: from mdounin.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mdounin.cust.ramtel.ru (Postfix) with ESMTP id C519217015; Tue, 14 Sep 2010 14:35:49 +0400 (MSD) Date: Tue, 14 Sep 2010 14:35:49 +0400 From: Maxim Dounin To: Ian FREISLICH Message-ID: <20100914103549.GI99657@mdounin.ru> References: <4C8E0C1E.2020707@networx.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-net@freebsd.org, Andre Oppermann , freebsd-current@freebsd.org, Fabien Thomas Subject: Re: TCP loopback socket fusing 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: Tue, 14 Sep 2010 11:00:52 -0000 Hello! On Tue, Sep 14, 2010 at 12:12:03PM +0200, Ian FREISLICH wrote: > Fabien Thomas wrote: > > Great, > > > > This will maybe kill the long time debate about "my loopback is slow vs > > linux" > > To have the best of both world what about a socket option to > > enable/disable fusing: > > can be useful when you need to see some connection "packetized". > > To chime in, I had a "slow" loopback issue earlier this week. It > turned out the problem was caused by delayed ack on the loopback > where the client didn't need to transmit any data to the server. > It delayed each packet from the server by 100ms. After patching > the server to: > > setsockopt(desc->accept_fd, IPPROTO_TCP, TCP_NODELAY, &x, sizeof(x)); > > It's now faster than on linux. > > Perhaps this is one of the causes of "my loopback is slow vs linux". > > FWIW, I couldn't find a way to turn off dealyed_ack on just loopback > interface. AFAIK in linux delayed ack behaves a bit more gently and doesn't delay first ack(s) in a connection. As a result linux hides some classic delayed ack vs. Nagle problems. Something similar probably should be adapted. Maxim Dounin