httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Sutherland <ja...@cam.ac.uk>
Subject Re: AP_MIN_SENDFILE_BYTES
Date Fri, 02 Feb 2001 15:36:29 GMT
On Fri, 2 Feb 2001 rbb@covalent.net wrote:

> > > >Incidentally, does anyone know if a writev() will combine the chunks into
> > > >large packets, or send each section individually??
> > > 
> > > The former.
> > 
> > Whereas using sendfile() for each chunk will generate lots of little
> > packetlets... mmap()+writev() seems like the way to go, then??
> 
> Yep.  Basically, there needs to be a cut-off, so that we don't sendfile a
> lot of little files.  We are much better off with a hierarchy:
> 
> read  if it's really small,
> mmap or sendfile if it's a bit bigger.

I think for byterange requests, mmap()+writev() would be the best - the
other two options won't merge packets, which will be a performance
hit. Even for tiny files, getting bytes 5-10,10-15 would be better under
mmap()+writev() - read/write and sendfile will both send two tiny packets,
it seems.

So:

read()+write() for "normal" GETs on tiny files
sendfile() on "normal" GETs on bigger files
mmap()+writev() for multiple byteranges, whatever the size

I think that's the right structure??


James.


Mime
View raw message