From owner-freebsd-net Tue Sep 19 8:58: 9 2000 Delivered-To: freebsd-net@freebsd.org Received: from tesseract.intercosmos.net (tesseract.intercosmos.net [64.16.142.88]) by hub.freebsd.org (Postfix) with ESMTP id 3F89037B422 for ; Tue, 19 Sep 2000 08:58:06 -0700 (PDT) Received: from localhost (weston@localhost) by tesseract.intercosmos.net (8.9.3/8.9.3) with ESMTP id KAA21494 for ; Tue, 19 Sep 2000 10:57:21 -0500 X-Authentication-Warning: tesseract.intercosmos.net: weston owned process doing -bs Date: Tue, 19 Sep 2000 10:57:20 -0500 (CDT) From: William Weston X-Sender: weston@tesseract.intercosmos.net To: freebsd-net@freebsd.org Subject: sendfile() questions Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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. --William Weston -- /********************************************************************** * William Weston * * Corporate Wizard / C Hacker * * InterCosmos Media Group, Inc. http://www.intercosmos.com * * * * "Disco and mainframes...we've sure come a long way since the 70s!" * **********************************************************************/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message