httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <>
Subject Re: cvs commit: httpd-2.0/modules/http http_core.c
Date Wed, 24 Jan 2001 15:28:05 GMT
From: "Bill Stoddard" <>
Sent: Wednesday, January 24, 2001 8:51 AM

> > On Tue, Jan 23, 2001 at 11:05:20PM -0000, wrote:
> > > rbb         01/01/23 15:05:19
> > >
> > >   Modified:    modules/http http_core.c
> > >   Log:
> > >   Fix the core_output_filter.  It doesn't make any sense to send less than
> > >   8K of a file using sendfile, it is easier to just read strings from the
> > >   file and use those strings directly.
> >
> > Do we have any performance testing to back this up? Why would sendfile of
> > less than 8k be slower than read-file/send-socket?
> >
> > I'd much rather see it remain simple and always use sendfile when a file is
> > supplied.
> I have to agree with Greg on this.  And the 'magic size' of 8k will vary
> depending on the platform. On Windows, I don't think sendfile hurts you on
> small files; it just may not help. Also, the completely breaks Windows when
> the file handle is cached. The cached handle is opened for async file i/o
> (necessary to share it with other threads in the process as discussed in
> earlier posts) which means that you should NOT be calling apr_read on it. The
> resultsof doing a non-overlapped read on a Windows file handle opened for
> overlapped i/o is unpredictable.

Win9x : sendfile doesn't work (correct?)

WinNT/2K:  A file opened for the thread, and using sendfile within the thread
           will succeed.

           A file opened APR_XTHREAD (our phrase for overlapped i/o) and
           served by several threads succeeds.

           A file opened without APR_XTHREAD, and 'adopted' by a caching
           module, will fail on sendfile.  The only way for a file to be tossed
           into the cache will be duping it with the APR_XTHREAD flag.

You aren't going to believe why I don't have the answer to Win9x at my fingertips.
The Whistler (64 bit NT) SDK docs --dropped-- sendfile from the documentation.
I'm not kidding.

The comments about not calling apr_read on a file opened with APR_XTHREAD ... 
that's an internal implementation detail we must revisit.  We will need to keep 
a record offset internally and call with overlapped i/o semantics for every 
read/write.  It's not on my list this week, but I want to see it happen soonish.

View raw message