From owner-freebsd-net Mon Jun 24 15:20:33 2002 Delivered-To: freebsd-net@freebsd.org Received: from sccrmhc03.attbi.com (sccrmhc03.attbi.com [204.127.202.63]) by hub.freebsd.org (Postfix) with ESMTP id 3055C37B403 for ; Mon, 24 Jun 2002 15:20:08 -0700 (PDT) Received: from InterJet.elischer.org ([12.232.206.8]) by sccrmhc03.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020624222007.WRQS903.sccrmhc03.attbi.com@InterJet.elischer.org>; Mon, 24 Jun 2002 22:20:07 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id PAA54473; Mon, 24 Jun 2002 15:11:01 -0700 (PDT) Date: Mon, 24 Jun 2002 15:11:00 -0700 (PDT) From: Julian Elischer To: Marc Slemko Cc: net@FreeBSD.ORG Subject: Re: apache and option USE_FLOCK_SERIALIZED_ACCEPT In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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