Re: sendfile()

David L. Parsley (kparse@salem.k12.va.us)
Fri, 14 May 1999 11:20:08 -0400 (EDT)


On Thu, 13 May 1999, John Myers wrote:

> System-call overhead is not the problem with omitting a header argument
> to sendfile(). The problem with omitting a header argument to
> sendfile() is that the write() causes the header to be sent out as a
> short packet. When the application next calls sendfile(), it gets
> nailed by Nagle's algorithm.

No, I remember this discussion from when sendfile() was originally
introduced, and this is taken care of. I don't remember the exact
mechanism discussed at the time, but from reading the manpages for
sendfile(2) and tcp(4), it appears you can use the socket option TCP_CORK;
from tcp(4):

TCP_CORK
If enabled don't send out partial frames. All
queued partial frames are sent when the option is
cleared again. This is useful for prepending head-
ers before calling sendfile(2), or for throughput
optimization. This option cannot be combined with
TCP_NODELAY.

It seems like I remember discussion of a mechanism for signalling the tcp
stack when it's ok to go ahead and send out, but I'm not sure of this.
DaveM would know...

cheers,
David

- --
David L. Parsley
Network Specialist
City of Salem Schools

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/