HH> I see a problem here. First - sendfile() will take some time
HH> even for a file in memory. Particularly a really big file.
HH> So you'll be blocking for a while,
HH> possibly delaying requests coming in via other network interfaces.
HH> Some other cpu could serve them.
The trick would be to fill the socket-buffer and THEN stop sendfile with
EWOULDBLOCK, so that only kilobytes (instead of possibly megabytes) are
transfered at a time. This way, one can keep the socket-buffers full
(allowing full network-throughput) while keeping the time in one sendfile()
relatively small.
Note that kHTTPd tries to do just this.
Greetings,
Arjan van de Ven
-
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/