From owner-freebsd-net Wed Sep 20 2:10:44 2000 Delivered-To: freebsd-net@freebsd.org Received: from implode.root.com (root.com [209.102.106.178]) by hub.freebsd.org (Postfix) with ESMTP id 9627737B423 for ; Wed, 20 Sep 2000 02:10:41 -0700 (PDT) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.8/8.8.5) with ESMTP id CAA05341; Wed, 20 Sep 2000 02:06:14 -0700 (PDT) Message-Id: <200009200906.CAA05341@implode.root.com> To: William Weston Cc: freebsd-net@FreeBSD.ORG Subject: Re: sendfile() questions In-reply-to: Your message of "Tue, 19 Sep 2000 10:57:20 CDT." From: David Greenman Reply-To: dg@root.com Date: Wed, 20 Sep 2000 02:06:14 -0700 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >I'm updating my company's web server software for use under FreeBSD-4.1, >and I'm having troubles with the new? behavior of sendfile(). I'm only >getting partial writes on files larger than about 16k, using both blocking >and non-blocking IO on the network sockets. Our implementation using >sendfile() works fine under FreeBSD-3.1 through FreeBSD-3.5.1. > > >Ok.... so here's my questions: > >Has behavior of sendfile() changed since FreeBSD-3.X? > >What can cause a zero-write condition (without errors!) on a socket >descriptor deemed by select() to be ready for writing? > >Are there any buffer sizes in the kernel that can be increased to make >sendfile() happier with larger files? (I wouldn't expect this, because >sendfile() is supposed to be "zero-copy"...) > >Are there any socket options I should be using when utilising sendfile()? > >Is it better to put a packet header into an iovec and have sendfile() take >care of it, or to write the header to the socket using writev() (or >something similar) and then use sendfile just for sending the file off the >filesystem? > > >Any help here (even a "sendfile is broken, so use something >else" reply) will be greatly appreciated. How many concurrent TCP connections are you using sendfile with? You could be running out of sf_bufs. This is controlled with the NSFBUFS kernel option. I'm not aware of any bugs in sendfile() at this time. -DG David Greenman Co-founder, The FreeBSD Project - http://www.freebsd.org President, TeraSolutions, Inc. - http://www.terasolutions.com Pave the road of life with opportunities. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message