Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Apr 1997 13:34:29 -0700 (MST)
From:      Marc Slemko <marcs@znep.com>
To:        David Greenman <dg@root.com>
Cc:        FreeBSD-hackers <FreeBSD-hackers@freebsd.org>
Subject:   Re: apache like preforking apps and high loads 
Message-ID:  <Pine.BSF.3.95.970403130536.2532B-100000@alive.znep.com>
In-Reply-To: <199704031527.HAA03657@root.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 3 Apr 1997, David Greenman wrote:

> >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.

Looking at these changes and the other code around them, it appears to me
like the net effect is that processes are added to the tail of the queue
when they block on accept()  and removed from (near) the head with
wakeup_one.  Am I reading this right, or am I getting my queue ends mixed
up somewhere?

For code that does similar things to what Apache does, it would be far
better to treat it as a stack and have wakeup_one() remove from the tail
since you want the same processes to serve as many requests as possible. 
In the grand scheme of things it may be a bad idea to have wakeup_one() 
behave this way, but it looks like it would be useful in this case. 





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