From owner-freebsd-hackers Thu Apr 3 08:52:50 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id IAA02067 for hackers-outgoing; Thu, 3 Apr 1997 08:52:50 -0800 (PST) Received: from chai.plexuscom.com (chai.plexuscom.com [207.87.46.100]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id IAA02061 for ; Thu, 3 Apr 1997 08:52:47 -0800 (PST) Received: from chai.plexuscom.com (localhost [127.0.0.1]) by chai.plexuscom.com (8.8.5/8.8.5) with ESMTP id LAA20772; Thu, 3 Apr 1997 11:53:34 -0500 (EST) Message-Id: <199704031653.LAA20772@chai.plexuscom.com> To: dg@root.com Cc: Guido van Rooij , FreeBSD-hackers@freebsd.org (FreeBSD-hackers) Subject: Re: apache like preforking apps and high loads In-reply-to: Your message of "Thu, 03 Apr 1997 07:27:26 PST." <199704031527.HAA03657@root.com> Date: Thu, 03 Apr 1997 11:53:34 -0500 From: Bakul Shah Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > >When looking at Apacha like applications, one often sees extermely high > >load averages. Apache preforks a number of processes that all block > >on accept(). When a request comes in, all process are woken up and the > >scheduler chooses one of the now runnable processes taht will succeed in > >the accept(). The other go back to sleep. > > Not any more. I changed this a few days ago. Now only one process is > woken up. Fairness is probably not an issue when an app. consists of a number of anonymous servers but in general one would want to make sure that if N processes are waiting on accept() on the same socket, no one process is starved of accepting. How do you ensure that? To guido: For apache like apps one idea is to have one process be the acceptor and have it pass a new socket to individual server processes (including doing some initial processing to determine which process should get this socket if not all server processes are equivalent). -- bakul