Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Sep 2000 02:06:14 -0700
From:      David Greenman <dg@root.com>
To:        William Weston <weston@intercosmos.com>
Cc:        freebsd-net@FreeBSD.ORG
Subject:   Re: sendfile() questions 
Message-ID:  <200009200906.CAA05341@implode.root.com>
In-Reply-To: Your message of "Tue, 19 Sep 2000 10:57:20 CDT." <Pine.LNX.4.21.0009190916190.10738-100000@tesseract.intercosmos.net> 

next in thread | previous 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.

   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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200009200906.CAA05341>