On Mon, 24 Jun 2002, Marc Slemko wrote:
> On Mon, 24 Jun 2002, Julian Elischer wrote:
>
> >
> > for FreeBSD we seem to get this option set..
> >
> > this seems bogus..
> >
> > it assumes that multiple processes can't listen on the accept
> > at one time...
>
> That is one use for accept serialization.
>
> However, the other reason has to do with multiple listening sockets and
> how Apache deals with them.
>
> Apache does a select() on all listening sockets, waiting for a
> connection to be ready on one. eg. different virtual hosts.
>
> That select() returns a set of sockets, we then do an accept() on one.
OK then if we know we have only one listenning socket,
(I presume that's what SINGLE_LISTEN_UNSERIALIZED_ACCEPT means)
then it just uses a raw accept right?
The proble we are seeing is apache occasionally has a process
freeze while it has the token (flock) and everything comes to a grinding
halt after a while...
Since we have to upgrate now anyhow due to chunking (whatever that is)
we'll see if maybe the problem is fixed with the upgrade.....
>
> Without accept serialization, there is a race condition where one child
> could do the select(), then another child could come in, do the select()
> do the accept() and accept the connection, then the first child's accept()
> blocks. If this happens too much, you end up with children blocked in
> accept() on one listening socket, which leaves no children to process
> requests from other listening sockets.
>
> > does anyone know if FreeBSD is safe for having multiple processes do
> > accept() on the same listenning socket?
>
> Yes, it is.
>
> FreeBSD also gets SINGLE_LISTEN_UNSERIALIZED_ACCEPT set, which says to
> not use accept serialization if you only have a single listen socket, since
> then the above worry doesn't matter.
>
>
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message