httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <...@covalent.net>
Subject Re: Threaded and ps->quiescing
Date Tue, 31 Jul 2001 20:16:08 GMT

You are describing the exact problem that is really almost impossible to fix.  This will be
fixed with the worker MPM, however that MPM needs a lot of work still.

Ryan

On Tuesday 31 July 2001 12:12, GUMMALAM,MOHAN (HP-Cupertino,ex2) wrote:
> Hi Greg:  Although the patch you sent fixes the problem of multiple pods,
> there are still some problems.  With the following configuration:
>
> StartServers         6
> MinSpareThreads      5
> MaxSpareThreads     50
>
> one would expect that when I start the web-server, since I have 6
> processes, hence 150 threads (all of them idle), the MaxSpareThreads is
> exceeded.  This should result in the killing of 4 spare processes.  This
> does not happen.  A "ps" will show that all the 6 processes are still
> around.
>
> The explanation is as follows, the p_i_s_m() would send 4 pods to kill the
> 4 spare processes, so that there are only 2 processes running.  While this
> is the correct behaviour, the processes which have recd the pod do not die
> immediately.
>
> This happens due to multiple threads (from all the 6 different processes)
> blocked at apr_lock_acquire(accept_mutex) statement in worker_thread()
> routine, as the accept_mutex is a server-wide mutex.  Since only one thread
> makes into the critical section, if the thread that enters the cs is from a
> process which hasn't recd a pod, then it would block at the apr_poll()
> routine.   Now the other threads from the processes that have recd the pod,
> are still blocked at apr_lock_acquire(), and hence cannot exit - causing
> the processes to be alive.
>
> Again, the patch that Justin re-posted, with two mutexes - per-process and
> server-wide - resolves the problem completely. (I say almost, as there is
> still a small timing window between two consecutive runs of p_i_s_m() and
> updating the quiescing flag within the worker_thread() routine).  Both the
> fixes together - yours and Justin's - will fix the problem.
>
> The patch Justin posted is with the new functions ap_mpm_pod_check() etc. 
> A similar patch with check_pipe_of_death() routines themselves could be
> used too - if you need, I could post that.
>
> Thoughts/comments?
>
> Thanks,
> M
>
> > -----Original Message-----
> > From: Greg Ames [mailto:gregames@remulak.net]
> > Sent: Monday, July 30, 2001 8:56 PM
> > To: new-httpd@apache.org
> > Subject: Re: tarballs are up
> >
> > "GUMMALAM,MOHAN (HP-Cupertino,ex2)" wrote:
> > > Greg:  Though I haven't completed testing the fix you
> >
> > suggested, I am
> >
> > > certain it would resolve the situation of multiple pods
> >
> > being sent.  I had a
> >
> > > pretty similar suggestion, which I had sent to the list a
> >
> > while back, and
> >
> > > hence my conviction that this will work.  I'll let you know
> >
> > what comes
> >
> > > through!
> > > Thanks,
> > > M
> >
> > you're welcome - it's commited.
> >
> > I went back and saw the patch you posted earlier this month.
> > That would
> > have done the job, too.  My apologies for not paying enough
> > attention to
> > it at first - e-mail overload after being at sea for 2 1/2 weeks.
> >
> > You also mentioned a patch Justin posted with two mutexes:
> > >  Justin's patch of two mutexes did fix the problem, but I
> >
> > do not see it being included
> >
> > >  even now.
> >
> > Either I deleted that one, or I can't figure out which one it
> > is amongst
> > the others.  Justin, could you please re-post this one?
> >
> > and does anyone know where the new-httpd mail archive lives any more?
> >
> > Greg

-- 

_____________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
Covalent Technologies			rbb@covalent.net
-----------------------------------------------------------------------------

Mime
View raw message