Re: Is sendfile all that sexy?

dean gaudet (dean-list-linux-kernel@arctic.org)
Mon, 15 Jan 2001 08:05:32 -0800 (PST)


On Mon, 15 Jan 2001, Jonathan Thackray wrote:

> (Linux, FreeBSD, HP-UX, AIX, Tru64). The next cool feature to add to
> Linux is sendpath(), which does the open() before the sendfile()
> all combined into one system call.

how would sendpath() construct the Content-Length in the HTTP header?

it's totally unfortunate that the other unixes chose to combine writev()
into sendfile() rather than implementing TCP_CORK. TCP_CORK is useful for
FAR more than just sendfile() headers and footers. it's arguably the most
correct way to write server code. nagle/no-nagle in the default BSD API
both suck -- nagle because it delays packets which need to be sent;
no-nagle because it can send incomplete packets.

i'm completely happy that linus, davem and ingo refused to combine
writev() into sendfile() and suggested CORK when i pointed out the
header/trailer problem.

imnsho if you want to optimise static file serving then it's pretty
pointless to continue working in userland. nobody is going to catch up
with all the kernel-side implementations in linux, NT, and solaris.

-dean

p.s. linus, apache-1.3 does *not* use sendfile(). it's in apache-2.0,
which unfortunately is now performing like crap because they didn't listen
to some of my advice well over a year ago. a case of "let's make a pretty
API and hope performance works out"... where i told them "i've already
written code using the API you suggest, and it *doesn't* work." </rant>
thankfully linux now has TUX.

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