From owner-freebsd-arch@FreeBSD.ORG Tue May 27 11:31:37 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A3F4637B49E for ; Tue, 27 May 2003 11:31:36 -0700 (PDT) Received: from rhombus.znep.com (sense-sea-MegaSub-1-507.oz.net [216.39.145.253]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9B27443FB1 for ; Tue, 27 May 2003 11:31:35 -0700 (PDT) (envelope-from marcs@znep.com) Received: by rhombus.znep.com (Postfix, from userid 1000) id 003551A326; Tue, 27 May 2003 11:31:34 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by rhombus.znep.com (Postfix) with ESMTP id EC3DF1AAA5 for ; Tue, 27 May 2003 11:31:34 -0700 (PDT) Date: Tue, 27 May 2003 11:31:34 -0700 (PDT) From: Marc Slemko To: arch@freebsd.org In-Reply-To: <20030527113138.GD44520@cirb503493.alcatel.com.au> Message-ID: References: <3ED33487.59C03DA9@mindspring.com> <20030527113138.GD44520@cirb503493.alcatel.com.au> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: sendfile(2) SF_NOPUSH flag proposal X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2003 18:31:38 -0000 On Tue, 27 May 2003, Peter Jeremy wrote: > On Tue, May 27, 2003 at 02:49:35PM +0400, Igor Sysoev wrote: > >Actually 6 vs. 6 for this 8K file. But I said about another thing. > >Let's see 48K file and 250 bytes header. sendfile() usually sends > >it as 4K or 8K hunks so there are 48/8 * 6 + 1 (header) = 37 packets. > >But (48K + 250) / 1460 = 33 * 1460 + 1270 i.e. 34 packets. > >It's 8% decrease of data packets. Add here the possible retransmitions. > > Why is the number of data packets so important? If you repeat the > calculation considering bytes across the wire (assuming Ethernet), > then the saving is closer to 0.4% - this is in the noise. I think Ethernet is pretty close to the best case here, other link layers have significantly higher overheads. Granted, it still is fairly low but not noise. > For that matter, have you considered the impact of Path MTU discovery? Withput PMTU-D, the overhead in number of packets would normally be a smaller percent because your MTU will be lower... what are you suggesting? > I think possible retransmissions are irrelevant here. If your packet > loss is anything above negligible then you have other problems. If > the retransmission is caused by transmission noise, then the smaller > packets are less likely to get hit. And the sender is likely to > retransmit a full packet rather than the small packet originally sent. The reality is that there are many environments where packet loss is a fact of life, and TCP can and does deal with it. I think you will find that the majority of packet loss on the Internet is due to events that are independent of the size of the packet, sugh as many types of buffer overflow. The number of packets also matters from the perspective of a lot of networking equipment that has a heavy per packet overhead, then minimal per byte overhead after that. Regardless of all this, which gets more and more complex to analyze once you look at all the complex behaviours of what routers actually do these days on the net, it is just a "good thing"(tm) to do to ensure that your application uses the minimal number of packets practical.