httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Terbush <>
Subject Re: systems without accept_mutex, bug?
Date Sat, 19 Apr 1997 15:18:34 GMT
It sounds to me like this scenario could cause the problems I see 
on FreeBSD with tons of swap usage. Children get swapped out 
blocked on accept().

My hunt for this problem continues to lead me back to this area, 
but I am not familiar enough with this mechanism to confirm a 

I'll try serializing a server to see what happens.

> I've been peering at child_main.  Suppose you're on a system which doesn't
> use accept_mutex().  Suppose that your configuration has multiple Listens
> so that you've got multiple sockets to select() on.  Now, all the idle
> children end up in select() at the same time.  It is possible that
> connections will be waiting on multiple sockets.  So multiple children
> leave select() with multiple sockets listed in main_fds.
> All those children wander down to the accept().  Notice that they're all
> going to run accept() on the *same socket* (well assuming that main_fds is
> the same).  Our listening sockets are blocking, so all but one of them is
> about to block in accept().
> That doesn't seem like a good situation to be in.  It results in
> starvation of the other sockets.
> Why *doesn't* this happen?  I'm assuming it doesn't, because otherwise
> architectures without USE_FCNTL_SERIALIZED_ACCEPT or
> USE_FLOCK_SERIALIZED_ACCEPT would have real problems handling Listen
> directives.
> Maybe it is happening, but not as bad as it could be.  For example, it
> could just be that a few children get blocked like this, or that the
> sockets are busy enough to not really notice it... 
> Dean

View raw message