httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Date Fri, 02 Feb 2001 16:47:36 GMT

> > > read()+write() for "normal" GETs on tiny files
> > > sendfile() on "normal" GETs on bigger files
> > > mmap()+writev() for multiple byteranges, whatever the size
> > 
> > When I talk about read, I expect us to use writev, so we will merge
> > packets. 
> Yes - will multiple small reads be merged, though?
> If we get a request like bytes 1-5, 10-20, 25-75..., unless the read is
> merged into a single bigger read, mmap() will probably be the winner
> there. Just fault in the first page, and access directly.
> Of course, logic to merge reads like that together into a 4k read would be
> better still...

That is done with the ap_f* functionst that I have been trying to get into
the code.  The MMAP and read options will both use the exact same writev
logic, so the packet merging will be exactly the same.

> > Also, even for byterange requests, we will want to use
> > sendfile.  Imagine a byterange request for 15000 bytes from a 10Meg
> > file.   This can be sent using sendfile instead of mmap.
> Yes - that's a single range, so it would be anyway under the logic
> above. If you're hopping around, though, multiple sendfile()s will hurt
> much more than an mmap().

Now extend that, to something like

Range:  bytes=0-10000, 15000-25000

Sendfile will help with that case.  It really has to do with the length of
the data, not the type of the request.


Ryan Bloom               
406 29th St.
San Francisco, CA 94131

View raw message