From owner-freebsd-hackers Sun Aug 16 12:37:10 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA11939 for freebsd-hackers-outgoing; Sun, 16 Aug 1998 12:37:10 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from redfish.go2net.com (redfish.go2net.com [207.178.55.5]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id MAA11931 for ; Sun, 16 Aug 1998 12:37:08 -0700 (PDT) (envelope-from marcs@go2net.com) Received: from marcs by redfish.go2net.com with smtp (Exim 1.82 #2) id 0z88aW-0006rL-00; Sun, 16 Aug 1998 12:35:36 -0700 Date: Sun, 16 Aug 1998 12:35:36 -0700 (PDT) From: Marc Slemko X-Sender: marcs@redfish To: Andre Oppermann cc: hackers@FreeBSD.ORG Subject: Re: sendfile() API? In-Reply-To: <35D7292D.7FBBA95@pipeline.ch> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 16 Aug 1998, Andre Oppermann wrote: > I'm currently evaluating the Zeus 3.1 Webserver (it finally available > for FreeBSD: www.zeus.co.uk) and in the tuning document they talk about > an sendfile() API which is currently only supportet on HP/UX 11.00: > http://support.zeus.co.uk/tuning.htm > > I'm now wondering what exactly that is and if someone has more details > or documents on that. It is a system call that allows you to pass in a file descriptor and a network socket and some other stuff. The kernel can then figure out how it can best shove the file to the network without having to copy into userspace. It still may or may not have to copy in the kernel, depending on implementation. There is a man page for the HPUX sendfile() at: http://docs.hp.com:80/dynaweb/hpux11/hpuxen1a/rvl3en1a/@Generic__BookTextView/59894;td=3 Note that the HPUX implementation does have some problems with the semantics, you really need an async sendfile() to do things right without wasting threads, you really need to be able to pass multiple headers and trailers in to do things right, etc. > > They state sendfile() gives excellent Webserver performace, isn't that > somthing for FreeBSD? sendfile() gives pretty good performance when combined with a file descriptor cache (ie. the web server doesn't do anything silly like cache data, it just keeps a bunch of descriptors open to sendfile() on), but the implementation has to be right and it is really an interm solution. The more general concept is any descriptor to any descriptor, and the future for web server performance could involve a small, in-kernel HTTP engine (eg. IBM's AFPA) backed by a webserver that handles cache population and any request that requires thinking plus if HTTP-NG becomes a reality (which it may well not since the W3C is shoving all sorts of "distributed object" crap into it; MUX may end up being deployed seperately though...), multiplexing multiple transfers over a single socket with MUX will mean that you can't use a sendfile() that usefully anyway. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message