From owner-freebsd-arch@FreeBSD.ORG Tue May 27 04:41:12 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 D9C4237B401 for ; Tue, 27 May 2003 04:41:12 -0700 (PDT) Received: from cirb503493.alcatel.com.au (c18609.belrs1.nsw.optusnet.com.au [210.49.80.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id D315743F93 for ; Tue, 27 May 2003 04:41:11 -0700 (PDT) (envelope-from peterjeremy@optushome.com.au) Received: from cirb503493.alcatel.com.au (localhost.alcatel.com.au [127.0.0.1])h4RBfAp9044784; Tue, 27 May 2003 21:41:10 +1000 (EST) (envelope-from jeremyp@cirb503493.alcatel.com.au) Received: (from jeremyp@localhost) by cirb503493.alcatel.com.au (8.12.8/8.12.8/Submit) id h4RBfAMf044783; Tue, 27 May 2003 21:41:10 +1000 (EST) Date: Tue, 27 May 2003 21:41:10 +1000 From: Peter Jeremy To: Igor Sysoev Message-ID: <20030527114110.GE44520@cirb503493.alcatel.com.au> References: <20030527102806.GC44520@cirb503493.alcatel.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i cc: arch@freebsd.org 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 11:41:13 -0000 On Tue, May 27, 2003 at 03:25:31PM +0400, Igor Sysoev wrote: >On Tue, 27 May 2003, Peter Jeremy wrote: > >> 2) The new feature provides significant performance benefit. In this >> case, I believe the overhead of calling setsockopt(2) is negligible >> so the performance gain would be negligible. > >I think the calling setsockopt(TCP_NOPUSH, 1) syscall has huge overhead >as compared to several C operators inside sendfile(2). Agreed. But needing another one or two relatively cheap system calls is negligible compared to the total overhead of accept(), several select()/poll()/kqueue() calls, several sendfile() calls and a close(). If you can produce some figures demonstrating that two setsockopt() syscalls makes a noticable difference to the total cost of sending a 48K file then your change might be worth considering. >My point is not "the cheap change" but "the cheap overhead". Please quantify the improvement amortised over a complete transaction or connection. Peter