httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: Apache 2.0/NSPR
Date Fri, 11 Sep 1998 15:28:46 GMT


On Thu, 10 Sep 1998, Jim Gettys wrote:

> Yes, turn off Nagle once you do your own buffering...

Yup we went through a discussion of this on linux-kernel when talking
about the pros and cons of various sendfile() and similar implementations. 
What we were trying to avoid is the all-singing-all-dancing syscall like
NT's TransmetaFile or HPUX's sendfile()... which are essentially crippled
writev() + sendfile(). 

For linux, syscalls are so cheap (and become even cheaper on x86 with
SYSENTER/EXIT...) that we're trying to avoid combining everything into a
single call.  It just doesn't seem worth it.  So instead the focus was on
making it possible to avoid the explicit packet flushing that
write()/writev() cause and let the app say when it's ready for a packet
boundary.  I think the two proposals tossed around were 0-length write() 
(or 0-length element in a writev()), or an explicit ioctl() that causes
the flush. 

The reason I say HPUX's sendfile() is crippled is that it only allows for
a single header and a single trailer.  Whereas for fast cached serving I
think there are at least 2 header buffers necessary -- one which includes
a shared "Date:" header, and one which includes the rest.  Sure it's
possible to just reformat the 250 or so bytes of the header and then call
sendfile()... but that's a waste -- those will be copied twice, once by
the app and once by the kernel.  A shame. 

Dean



Mime
View raw message