Subject: Re: Ongoing projects
To: Andrew Doran <ad@fionn.sports.gov.uk>
From: Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us>
List: tech-kern
Date: 05/07/1999 10:03:18
> write/sendto will do fine for headers.
Actually, for TCP, this isn't the case as long as our stack views each
socket write syscall as an implicit "push". (if you don't know what I
mean, think "fflush, at the tcp layer").
Given interactions between this, slow start, and the Nagle algorithm,
writing headers separately will mean an extra round trip time on
many/most fetches (since the headers will end up in a tcp segment by
themselves, and a second segment, with the first part of the file
contents, won't be sent until the first one is acked..)
I happen to think that the right answer here is a tcp layer socket
option to turn off implicit push, plus rigging up another system call
(fsync(2)? :-) ) to be an explicit push... but in the absence of
that, it may actually hurt your performance to send headers in a
separate call instead of with the first few blocks of the file in one
big writev() call..
- Bill