sendfile() and related
matters with Linus Torvalds and Dan Kegel
(who has an
interesting page about high-capacity servers).
sendfile() depends on the
TCP_CORK socket option to avoid undesirable
packet boundaries. FreeBSD has a similar option (part of the
T/TCP extensions) called
TCP_NOPUSH; there is a
subtle difference, though: when
TCP_CORK is turned
off any buffered data is sent immediately, but this is not the
TCP_NOPUSH. The Linux behaviour is
helpful because, for example, it avoids you to avoid awkward
delays waiting for the last packet of an HTTP response. I developed
kernel patch for FreeBSD which makes
TCP_CORK, which is in FreeBSD-4.5 and later.
Although there was some discussion about making FreeBSD and Linux more compatible in this area, it stalled because of problems with naming, with T/TCP, and with design philosophy.
I have a program which I
used to test the behaviour of
$dotat: doc/web/writing/nopush.html,v 1.3 2007/08/22 01:59:07 fanf2 Exp $