httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phillip Susi <ps...@cfl.rr.com>
Subject Re: Bandwidth Limit on Windows
Date Thu, 15 Sep 2005 19:10:34 GMT
When I asked about this a month or two ago, someone explained that 
Apache uses TransmitFile() to implement sendfile but in a weird way that 
makes it really, really slow.  Disabling sendfile in the apache config, 
and just using the mmap module gives the best throughput on windows.

I don't know if apache mmaps the entire file if it is large, but if it 
is very large, I don't see how it can as you only have a limited amount 
of virtual memory to work with.  Unless you run out of virtual memory ( 
i.e. lots of mapped files, or a single file that is several gigs ) then 
mapping the entire file isn't really a problem.

William A. Rowe, Jr. wrote:
> Phillip Susi wrote:
> 
>> Probably has to do with sendfile, always turn it off on windows.  I 
>> was seeing low throughput as well until I turned off sendfile, then 
>> over a 100 MBps network I got over 11,000 KB/s.
>>
>> Apparently apache has a rather horrible emulation of sendfile on 
>> windows for some reason or another.
> 
> 
> Sendfile != MMap.
> 
> In the case of Sendfile, it's using the Win32 API TransmitFile().  In
> the case of MMap, the file is mapped into virtual memory, and loaded
> into physical memory.  Apache prefers Sendfile, if both are available,
> IIRC.
> 
> However, the way Apache/APR MMAPs the entire file is quite probably
> sub-optimal for some resources.
> 
> Bill
> 


Mime
View raw message