Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Jun 2002 15:11:00 -0700 (PDT)
From:      Julian Elischer <julian@elischer.org>
To:        Marc Slemko <marcs@znep.com>
Cc:        net@FreeBSD.ORG
Subject:   Re: apache and option USE_FLOCK_SERIALIZED_ACCEPT
Message-ID:  <Pine.BSF.4.21.0206241505410.53897-100000@InterJet.elischer.org>
In-Reply-To: <Pine.BSF.4.20.0206241429120.38173-100000@alive.znep.com>

next in thread | previous in thread | raw e-mail | index | archive | help


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 majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0206241505410.53897-100000>