On 23 Jun 2000, David Hodgkinson wrote:

> 
> Stas Bekman <[EMAIL PROTECTED]> writes:
> 
> > On 23 Jun 2000, David Hodgkinson wrote:
> > 
> > > 
> > > Justin <[EMAIL PROTECTED]> writes:
> > > 
> > > > What I think happens is the children die after their last request,
> > > > and apache does not kick off a new child straight away.. MinFree is
> > > > set to 2 .. as 12 becomes 11 becomes 10 becomes 9, my backend is
> > > > getting less and less powerful and more and more swamped. When
> > > > Apache does wakeup and spawn a new child, it takes many seconds
> > > > to interpret all the (large amount) of perl code and modules that
> > > > are not in the parent... up to 10 seconds now since its only getting
> > > > a fraction of the box.. this gives the unlucky user a dead browser.
> > > > Worse, the remaining alive servers are dieing faster now as they
> > > > handle more and more of the load, and rush towards 500 to contribute
> > > > to the same traffic jam of booting children.
> > >  
> > > I'd worry about the cranking up time. It sounds like you need to
> > > preload your modules in the parent process.
> > > 
> > > Stas - please correct me if I'm wrong here, but preloading modules in
> > > startup.pl (or whatever) _does_ make a difference to the spawning time
> > > of an Apache daughter?
> > 
> > It makes no difference to the spawning time, since all the code is shared
> > at the beginning.
> 
> Isn't that what I said?! :-)

It isn't. You've said: "It _does_ make a difference", whereas I said: "It
doesn't make any difference". Your question was about spawning times, not
about the overhead added during the first request.

> If you take a large script, throw it at Apache::Registry, then you'll
> be compiling the script every time the a diaghter respawns.
>
> If you have your script largely preloaded when Apache starts spawning
> daughters, then you don't have that overhead.

That's wrong. The script won't be compiled until it will be used. When a
process gets spawned, it doesn't know what scripts/handlers it's going to
use if they are not preloaded. And if they are, they are shared.

> > When a new process is spawn 99.9% of the memory pages
> > are shared with parent. When the pages are getting dirty (some data
> > modified) a copy-on-write happen which slows things down, but it has
> > nothing to do with child spawning. The slowdown happens during the
> > request's processing.
> > 
> > If you don't preload your code, the first time a script need it the delay
> > of load and compilation will happen and there will be less memory shared.
> 
> 
> -- 
> Dave Hodgkinson,                             http://www.hodgkinson.org
> Editor-in-chief, The Highway Star           http://www.deep-purple.com
>       Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
>   -----------------------------------------------------------------
> 



_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://perl.org     http://stason.org/TULARC
http://singlesheaven.com http://perlmonth.com http://sourcegarden.org


Reply via email to