From owner-freebsd-net@FreeBSD.ORG Tue Sep 14 10:52:40 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1E23106566C for ; Tue, 14 Sep 2010 10:52:40 +0000 (UTC) (envelope-from ianf@clue.co.za) Received: from inbound01.jnb1.gp-online.net (inbound01.jnb1.gp-online.net [41.161.16.135]) by mx1.freebsd.org (Postfix) with ESMTP id 784D28FC1B for ; Tue, 14 Sep 2010 10:52:40 +0000 (UTC) Received: from [41.154.88.19] (helo=clue.co.za) by inbound01.jnb1.gp-online.net with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1OvSUj-0005aB-KJ; Tue, 14 Sep 2010 12:12:10 +0200 Received: from localhost ([127.0.0.1] helo=clue.co.za) by clue.co.za with esmtp (Exim 4.72 (FreeBSD)) (envelope-from ) id 1OvSUd-0000mU-0l; Tue, 14 Sep 2010 12:12:03 +0200 Message-Id: To: Fabien Thomas From: Ian FREISLICH In-Reply-To: References: <4C8E0C1E.2020707@networx.ch> X-Attribution: BOFH Date: Tue, 14 Sep 2010 12:12:03 +0200 Cc: freebsd-net@freebsd.org, freebsd-current@freebsd.org Subject: Re: TCP loopback socket fusing 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: Tue, 14 Sep 2010 10:52:41 -0000 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. Ian -- Ian Freislich