From owner-freebsd-arch@FreeBSD.ORG Tue May 27 11:14:09 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 D628837B401 for ; Tue, 27 May 2003 11:14:09 -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 0CA1943F3F for ; Tue, 27 May 2003 11:14:09 -0700 (PDT) (envelope-from marcs@znep.com) Received: by rhombus.znep.com (Postfix, from userid 1000) id 20D6A1A291; Tue, 27 May 2003 11:14:08 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by rhombus.znep.com (Postfix) with ESMTP id 190861AAA5 for ; Tue, 27 May 2003 11:14:08 -0700 (PDT) Date: Tue, 27 May 2003 11:14:07 -0700 (PDT) From: Marc Slemko To: arch@freebsd.org In-Reply-To: <3ED3844F.713FB360@mindspring.com> Message-ID: References: <20030526201740.GA22178@cirb503493.alcatel.com.au> <3ED3844F.713FB360@mindspring.com> 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:14:10 -0000 On Tue, 27 May 2003, Terry Lambert wrote: > The overhead of toggling it would be costly. However, I really > don't understand why he isn't just not setting TCP_NODELAY in > the first place, since it's an affirmative option, and then > leaaving the socket alone to act like it's supposed to act. Given the bug in FreeBSD's sendfile() that results in it sending the headers in a separate segment, then just leaving Nagle enabled will destroy your performance if you are implementing a protocol such as HTTP with persistent (pipelined or not) connections due to the interaction betwteen Nagle and delayed ack. However, that is somewhat of a moot point for HTTP anyway because if you support pipelined requests then for the most efficient implementation of HTTP on the network layer you need to ensure that the response headers and body from multiple requests can be coalesced into the same packet. When using sendfile(), this means you have to control TCP_NOPUSH yourself, even if sendfile coalesced headers, data, and trailers. sendfile() still should be fixed to properly coalesce them.