You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Justin <jb...@dslreports.com> on 2000/06/23 04:59:31 UTC

followup to MaxChildRequests question ;-(

I RTFM'd some more..

Seems like Apache::SizeLimit helps, if I switch to that, it
would avoid the galloping-herd-off-a-cliff problem I am seeing..

Its still worth stating for the purposes of getting into the
modperl archive at least, that MaxChildRequests is to be avoided
for modperl backend setups.

It would be nice to have Apache:RandomRequestLimit instead though..

-Justin

Re: followup to MaxChildRequests question ;-(

Posted by Justin <jb...@dslreports.com>.
On Fri, Jun 23, 2000 at 09:54:49AM -0400, Vivek Khera wrote:
> >>>>> "J" == Justin  <jb...@dslreports.com> writes:
> 
> J> Its still worth stating for the purposes of getting into the
> J> modperl archive at least, that MaxChildRequests is to be avoided
> J> for modperl backend setups.
> 
> I disagree.  You just need to have enough back-ends to make sure that
> you don't overwhelm the remaining ones for enough time that it takes
> to fire up a replacement.
> 
> And add more RAM.  You can never have enough RAM.  (and be sure to
> configure your operating system to allow mod_perl to use that
> additional RAM).
> 

I totally agree on the RAM - no paging on my box, thats the easiest
way to insanity..  nevertheless, ok let me modify this.. avoid
MaxChildRequests when they are set at a fairly low level, AND traffic
is sufficient to toggle them every 10 minutes or so AND your program
is so large that it takes 10+ seconds for a new child to get going
when the box is under pressure, because you then observe, I think,
a coordinated rush for the exit(0) every 10 minutes.

the goal of producing a stable back-end (not one where apache is
constantly killing and starting big children in response to spikes
in load) produces a stable of httpds that tick down at, on average,
the same rate.

On the questions from the previous post (sorry not to respond quickly)
MaxRequests was 12, MinSpareServers was 2, StartServers was 10.. this
would led to steady state of 12 processes.

I gave up on SizeLimit because I dont want to worry about what limit to
pick.. What I settled on was this : simply increment REQUEST_NO in
each child, and do:
 if ($REQUEST_NO++ > 500 && !($REQUEST_NO % 3) && rand()>0.98) {
   $r->child_terminate
 }

Probably a better way is:
 if (($REQUEST_NO++ > (400+$my_slot*100)) {
   $r->child_terminate;
 }

(MaxRequestsPerChild is set to something huge like 5000)

but I didnt know the variable for slot number and only just thought
of that..

thanks for the help!
-Justin

Re: followup to MaxChildRequests question ;-(

Posted by Vivek Khera <kh...@kciLink.com>.
>>>>> "J" == Justin  <jb...@dslreports.com> writes:

J> Its still worth stating for the purposes of getting into the
J> modperl archive at least, that MaxChildRequests is to be avoided
J> for modperl backend setups.

I disagree.  You just need to have enough back-ends to make sure that
you don't overwhelm the remaining ones for enough time that it takes
to fire up a replacement.

And add more RAM.  You can never have enough RAM.  (and be sure to
configure your operating system to allow mod_perl to use that
additional RAM).

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: khera@kciLink.com       Rockville, MD       +1-301-545-6996
GPG & MIME spoken here            http://www.khera.org/~vivek/