apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pane <bri...@apache.org>
Subject poll on OS X Re: pollset initialization within apr_file_open()?
Date Mon, 04 Jul 2005 22:28:43 GMT
On Jul 4, 2005, at 2:18 AM, Joe Orton wrote:

> On Sun, Jul 03, 2005 at 04:27:05PM -0700, Brian Pane wrote:
>
>
>> I just did some performance profiling of httpd-2.1 for the first time
>> in a long while.
>>
>> One of the odd things I noticed is that apr_file_open() appears to
>> spend half its time
>> in a call to apr_pollset_create().
>>
>> The pollset creation can be expensive, especially on platforms where
>> it's implemented using /dev/poll or kqueue.  And as far as I can  
>> tell.
>> the pollset is only used in the special case of
>> apr_wait_for_io_or_timeout() where the caller wants to wait on a  
>> file.
>>
>>
>
> Note that this problem only affects the very small number of platforms
> without a (working) poll() implementation.
>

Ah, that explains it: I'm using OS X 10.4, and this recent change  
disabled
the use of poll in APR on Darwin:
<http://svn.apache.org/viewcvs.cgi/apr/apr/trunk/build/apr_hints.m4? 
rev=179282&r1=178653&r2=179282>

I can develop a patch to do a lazy initialization of the pollset  
within the
apr_file_t, which should fix the httpd performance problems.

However, one of the later comments in bug 34332 notes that "disabling
poll() may not be necessary" on Darwin after all.  If anybody is  
actively
looking at the possibility of reenabling poll() on Darwin, please let me
know and I'll hold off on implementing the lazy-initialization fix  
for now.

Thanks,
Brian


Mime
View raw message