Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Sep 2000 10:57:20 -0500 (CDT)
From:      William Weston <weston@intercosmos.com>
To:        freebsd-net@freebsd.org
Subject:   sendfile() questions
Message-ID:  <Pine.LNX.4.21.0009190916190.10738-100000@tesseract.intercosmos.net>

next in thread | raw e-mail | index | archive | help
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                            <weston@intercosmos.com> *
 *                     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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.21.0009190916190.10738-100000>