Ryan Bloom wrote:

>On Sunday 09 September 2001 10:14, Cliff Woolley wrote:
>
>>On 9 Sep 2001, Ian Holsman wrote:
>>
>>>I was looking through the sendfile code, and it looks like we could
>>>use sendfile to transmit a memory-mapped bucket if we kept the
>>>file-descriptor when we create the mmap bucket.
>>>I don't have sendfile installed on solaris (yet) but I think
>>>sendfile is faster than writeev??
>>>if this is the case, I think we should add a function/flag/macro to the
>>>bucket-type is_sendfileable (which would be true for files/mmaps)
>>>instead of checking the type of the bucket explictly.
>>>
>>Just because you have an MMAP doesn't necessarily mean the original file
>>descriptor is still open, so you're not guaranteed that you can use
>>sendfile()...
>>
Right, although this isn't a problem with Apache because the file bucket
code doesn't close the fd when it does an mmap.

>I have thought about doing this for a long time, but I've been told that sendfile
>is essentially a writev, so it isn't a win.
>
On Linux, at least, it's a win.  I did some experiments a few weeks ago
and found that, after doing open and mmap on a file, it's faster to send
it with sendfile than with write.

--Brian



Reply via email to