From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 10 06:15:06 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7281B16A4CE for ; Mon, 10 Nov 2003 06:15:06 -0800 (PST) Received: from park.rambler.ru (park.rambler.ru [81.19.64.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8E87443FE5 for ; Mon, 10 Nov 2003 06:15:04 -0800 (PST) (envelope-from is@rambler-co.ru) Received: from is.park.rambler.ru (is.park.rambler.ru [81.19.64.102]) by park.rambler.ru (8.12.6/8.12.6) with ESMTP id hAAEENJ6030202; Mon, 10 Nov 2003 17:14:23 +0300 (MSK) (envelope-from is@rambler-co.ru) Date: Mon, 10 Nov 2003 17:14:23 +0300 (MSK) From: Igor Sysoev X-Sender: is@is.park.rambler.ru To: John-Mark Gurney In-Reply-To: <20031109182614.GH558@funkthat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org cc: Vivek Pai cc: Alan Cox Subject: Re: Update: Debox sendfile modifications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2003 14:15:06 -0000 On Sun, 9 Nov 2003, John-Mark Gurney wrote: > Igor Sysoev wrote this message on Sun, Nov 09, 2003 at 15:16 +0300: > > > If you made this a fd transparent operation then I would agree with > > > it. > > > > The current sendfile() implementation works with sockets only. > > Well, I agree that such sendfile() implementation is a hack. > > Nowever this implementation is very usefull in the real world - > > it allows to minimize a data copy in http and ftp servers. > > > > I just could not figure to myself where can be usefull the > > high perfomance sendfile() to a pipe. > > It's not so much of how, but optimizing for the general case, not > the specific case. I was using pipes as an example, what about for > coping one fd to another? Right now cp will try to mmap a 16meg buffer, > and use that, if it fails, it falls back to a read/write loop.. why > not do something like copyfd that does it more optimally? > > > I think that it's better to leave sendfile() as a sending to a socket > > only hack. I believe that any sendfile() generalization (e.g. sending > > data from a socket to a file) is useless. > > oh? why do you think that is useless? What about all the applications > like ftp clients, and wget/fetch/curl that do it on a regular basis? To notice some perfomance impact of using sendfile() in cp, wget, etc I need to run simultaneously hundreds of these applications. To see the perfomance impact of using sendfile() in http or ftp server I need to serve hundreds of clients. The first case is too rare while the second one is common for the busy servers. Igor Sysoev http://sysoev.ru/en/